Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp.../vendor/symfony/polyfill...
File: Php70.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* This file is part of the Symfony package.
[3] Fix | Delete
*
[4] Fix | Delete
* (c) Fabien Potencier <fabien@symfony.com>
[5] Fix | Delete
*
[6] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[7] Fix | Delete
* file that was distributed with this source code.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
namespace Symfony\Polyfill\Php70;
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* @author Nicolas Grekas <p@tchwork.com>
[14] Fix | Delete
*
[15] Fix | Delete
* @internal
[16] Fix | Delete
*/
[17] Fix | Delete
final class Php70
[18] Fix | Delete
{
[19] Fix | Delete
public static function intdiv($dividend, $divisor)
[20] Fix | Delete
{
[21] Fix | Delete
$dividend = self::intArg($dividend, __FUNCTION__, 1);
[22] Fix | Delete
$divisor = self::intArg($divisor, __FUNCTION__, 2);
[23] Fix | Delete
[24] Fix | Delete
if (0 === $divisor) {
[25] Fix | Delete
throw new \DivisionByZeroError('Division by zero');
[26] Fix | Delete
}
[27] Fix | Delete
if (-1 === $divisor && ~PHP_INT_MAX === $dividend) {
[28] Fix | Delete
throw new \ArithmeticError('Division of PHP_INT_MIN by -1 is not an integer');
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
return ($dividend - ($dividend % $divisor)) / $divisor;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
public static function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0)
[35] Fix | Delete
{
[36] Fix | Delete
$count = 0;
[37] Fix | Delete
$result = (string) $subject;
[38] Fix | Delete
if (0 === $limit = self::intArg($limit, __FUNCTION__, 3)) {
[39] Fix | Delete
return $result;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
foreach ($patterns as $pattern => $callback) {
[43] Fix | Delete
$result = preg_replace_callback($pattern, $callback, $result, $limit, $c);
[44] Fix | Delete
$count += $c;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
return $result;
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
public static function error_clear_last()
[51] Fix | Delete
{
[52] Fix | Delete
static $handler;
[53] Fix | Delete
if (!$handler) {
[54] Fix | Delete
$handler = function () { return false; };
[55] Fix | Delete
}
[56] Fix | Delete
set_error_handler($handler);
[57] Fix | Delete
@trigger_error('');
[58] Fix | Delete
restore_error_handler();
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
private static function intArg($value, $caller, $pos)
[62] Fix | Delete
{
[63] Fix | Delete
if (\is_int($value)) {
[64] Fix | Delete
return $value;
[65] Fix | Delete
}
[66] Fix | Delete
if (!\is_numeric($value) || PHP_INT_MAX <= ($value += 0) || ~PHP_INT_MAX >= $value) {
[67] Fix | Delete
throw new \TypeError(sprintf('%s() expects parameter %d to be integer, %s given', $caller, $pos, \gettype($value)));
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
return (int) $value;
[71] Fix | Delete
}
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function