Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zend/tests/bug47836.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ $arr[PHP_INT_MAX] = 1;
try {
$arr[] = 2;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

var_dump($arr);
?>
--EXPECTF--
Cannot add element to the array as the next element is already occupied
Error: Cannot add element to the array as the next element is already occupied
array(1) {
[%d]=>
int(1)
Expand Down
8 changes: 4 additions & 4 deletions Zend/tests/bug49893.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class A {
try {
throw new Exception("2");
} catch (Exception $e) {
echo $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
Expand All @@ -21,9 +21,9 @@ class B {
try {
$b = new B();
} catch(Exception $e) {
echo $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
2
1
Exception: 2
Exception: 1
24 changes: 12 additions & 12 deletions Zend/tests/bug52041.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ function foo() {
try {
foo()->a = 1;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b = 2;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a++;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b++;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a += 2;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b += 2;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

foo()[0] = 1;
Expand All @@ -48,22 +48,22 @@ var_dump(foo());
?>
--EXPECTF--
Warning: Undefined variable $x in %s on line %d
Attempt to assign property "a" on null
Error: Attempt to assign property "a" on null

Warning: Undefined variable $x in %s on line %d
Attempt to modify property "a" on null
Error: Attempt to modify property "a" on null

Warning: Undefined variable $x in %s on line %d
Attempt to increment/decrement property "a" on null
Error: Attempt to increment/decrement property "a" on null

Warning: Undefined variable $x in %s on line %d
Attempt to modify property "a" on null
Error: Attempt to modify property "a" on null

Warning: Undefined variable $x in %s on line %d
Attempt to assign property "a" on null
Error: Attempt to assign property "a" on null

Warning: Undefined variable $x in %s on line %d
Attempt to modify property "a" on null
Error: Attempt to modify property "a" on null

Warning: Undefined variable $x in %s on line %d

Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/bug52355.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ var_dump($foo);
try {
var_dump(1.0 / -0.0);
} catch (\DivisionByZeroError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
float(-0)
float(-0)
float(-0)
Division by zero
DivisionByZeroError: Division by zero
4 changes: 2 additions & 2 deletions Zend/tests/bug52614.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var_dump($foo->a3);
try {
$foo->f4()->a = 1;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->o1);

Expand All @@ -76,7 +76,7 @@ array(0) {
}
array(0) {
}
Attempt to assign property "a" on null
Error: Attempt to assign property "a" on null
NULL
object(stdClass)#3 (1) {
["a"]=>
Expand Down
10 changes: 5 additions & 5 deletions Zend/tests/bug53432.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ $str = '';
try {
var_dump($str['foo'] = 'a');
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);

$str = '';
try {
var_dump($str[] = 'a');
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);

$str = '';
try {
var_dump($str[0] += 1);
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);

$str = '';
try {
var_dump($str[0][0] = 'a');
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);

Expand All @@ -57,7 +57,7 @@ string(6) " a"
Warning: Illegal string offset -1 in %s on line %d
NULL
string(0) ""
Cannot access offset of type string on string
TypeError: Cannot access offset of type string on string
string(0) ""
Error: [] operator not supported for strings
string(0) ""
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/bug63882.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ $testobj2->x = $testobj2;
try {
var_dump($testobj1 == $testobj2);
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
Nesting level too deep - recursive dependency?
Error: Nesting level too deep - recursive dependency?
4 changes: 2 additions & 2 deletions Zend/tests/bug65784.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ try {
var_dump($foo);
} catch (Exception $e) {
do {
var_dump($e->getMessage());
echo $e::class, ': ', $e->getMessage(), "\n";
} while ($e = $e->getPrevious());
}

Expand Down Expand Up @@ -55,7 +55,7 @@ function foo3() {
$bar = foo3();
?>
--EXPECTF--
string(9) "not catch"
Exception: not catch
NULL

Fatal error: Uncaught Exception: not caught in %sbug65784.php:42
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/bug69017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ c1::$a2[] = 1;
try {
c1::$a3[] = 1;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

var_dump(c1::$a1);
var_dump(c1::$a2);
var_dump(c1::$a3);
?>
--EXPECTF--
Cannot add element to the array as the next element is already occupied
Error: Cannot add element to the array as the next element is already occupied
array(2) {
[1]=>
string(3) "one"
Expand Down
24 changes: 12 additions & 12 deletions Zend/tests/bug69315.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,41 @@ var_dump(is_callable("strlen"));
try {
var_dump(strlen("xxx"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(defined("PHP_VERSION"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(constant("PHP_VERSION"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(call_user_func("strlen"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(is_string("xxx"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(is_string());
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bool(false)
bool(false)
Call to undefined function strlen()
Call to undefined function defined()
Call to undefined function constant()
Call to undefined function call_user_func()
Call to undefined function is_string()
Call to undefined function is_string()
Error: Call to undefined function strlen()
Error: Call to undefined function defined()
Error: Call to undefined function constant()
Error: Call to undefined function call_user_func()
Error: Call to undefined function is_string()
Error: Call to undefined function is_string()
4 changes: 2 additions & 2 deletions Zend/tests/bug70083.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ $foo = new foo;
try {
$foo->i = &noref();
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo);

?>
--EXPECT--
Cannot assign by reference to overloaded object
Error: Cannot assign by reference to overloaded object
object(foo)#1 (1) {
["var":"foo":private]=>
NULL
Expand Down
16 changes: 8 additions & 8 deletions Zend/tests/bug70089.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ function dummy($a) {
try {
chr(0)[0][] = 1;
} catch (Error $e) {
var_dump($e->getMessage());
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset(chr(0)[0][0]);
} catch (Error $e) {
var_dump($e->getMessage());
echo $e::class, ': ', $e->getMessage(), "\n";
}
eval("function runtimetest(&\$a) {} ");
try {
runtimetest(chr(0)[0]);
} catch (Error $e) {
var_dump($e->getMessage());
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
++chr(0)[0];
} catch (Error $e) {
var_dump($e->getMessage());
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
string(36) "Cannot use string offset as an array"
string(36) "Cannot use string offset as an array"
string(47) "Cannot create references to/from string offsets"
string(41) "Cannot increment/decrement string offsets"
Error: Cannot use string offset as an array
Error: Cannot use string offset as an array
Error: Cannot create references to/from string offsets
Error: Cannot increment/decrement string offsets
2 changes: 1 addition & 1 deletion Zend/tests/bug70689.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set_error_handler(function($errno, $errstr) {
try {
foo();
} catch (Exception $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
Expand Down
12 changes: 6 additions & 6 deletions Zend/tests/bug70895.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ Bug #70895 null ptr deref and segfault with crafted callable
try {
array_map("%n", 0);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_map("%n %i", 0);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_map("%n %i aoeu %f aoeu %p", 0);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name
TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name
TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name
TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name
4 changes: 2 additions & 2 deletions Zend/tests/bug70898.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function m($f,$a){
try {
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name
TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name
4 changes: 2 additions & 2 deletions Zend/tests/bug70914.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $st = $db->query('SELECT 1');
try {
$re = $st->fetchObject('%Z');
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
TypeError: PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
Loading
Loading