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
12 changes: 6 additions & 6 deletions ext/opcache/tests/assign_obj_exceptions.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ function test_invalid_obj_type($c) {
try {
test_invalid_prop_type();
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_invalid_prop_name("\0");
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_invalid_obj_type(false);
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
Cannot assign string to property Test::$x of type stdClass
Cannot access property starting with "\0"
Attempt to assign property "x" on null
TypeError: Cannot assign string to property Test::$x of type stdClass
Error: Cannot access property starting with "\0"
Error: Attempt to assign property "x" on null
4 changes: 2 additions & 2 deletions ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ function test() {
try {
test();
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECTF--
Warning: Undefined array key 0 in %s on line %d
Attempt to assign property "y" on null
Error: Attempt to assign property "y" on null
4 changes: 2 additions & 2 deletions ext/opcache/tests/bug68104.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ var_dump(is_callable("dl"));
try {
dl("a.so");
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(false)
Call to undefined function dl()
Error: Call to undefined function dl()
4 changes: 2 additions & 2 deletions ext/opcache/tests/bug76796.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ opcache
try {
var_dump(strpos('foo', 'bar'));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
Call to undefined function strpos()
Error: Call to undefined function strpos()
1 change: 0 additions & 1 deletion ext/opcache/tests/bug78185.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ foreach (glob($pattern) as $p) {
?>
--EXPECTF--
string(%d) "%s78185.php.bin"

2 changes: 1 addition & 1 deletion ext/opcache/tests/get_configuration_matches_ini.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ var_dump(array_diff_key($inis, $opts));
?>
--EXPECT--
array(0) {
}
}
1 change: 0 additions & 1 deletion ext/opcache/tests/gh13817.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ Ok
</foo>
</outer>
</file '%s'>

4 changes: 2 additions & 2 deletions ext/opcache/tests/gh17422/002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ set_error_handler(static function (int $errno, string $errstr, string $errfile,
try {
require __DIR__ . "/warning.inc";
} catch (\Exception $e) {
echo "Caught: ", $e->getMessage(), PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

warning();

?>
--EXPECT--
Caught: "continue" targeting switch is equivalent to "break"
ErrorException: "continue" targeting switch is equivalent to "break"
OK: warning
4 changes: 2 additions & 2 deletions ext/opcache/tests/gh20628_borked_live_range_calc.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function test($cond) {
try {
test(true);
} catch (Throwable $e) {
echo $e::class, $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
ReflectionExceptionClass "non" does not exist
ReflectionException: Class "non" does not exist
8 changes: 4 additions & 4 deletions ext/opcache/tests/inc_array.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ function test_inc_partial_array($k) {
try {
test_inc_array();
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_inc_partial_array(0);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot increment array
Cannot increment array
TypeError: Cannot increment array
TypeError: Cannot increment array
16 changes: 8 additions & 8 deletions ext/opcache/tests/invalid_new_dce.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ function test4() {
$x = new Abc;
}

try { test1(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
try { test2(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
try { test3(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
try { test4(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
try { test1(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { test2(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { test3(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { test4(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }

?>
--EXPECT--
Cannot instantiate abstract class Foo
Cannot instantiate interface Bar
Cannot instantiate trait Baz
Cannot declare self-referencing constant Abc::BAR
Error: Cannot instantiate abstract class Foo
Error: Cannot instantiate interface Bar
Error: Cannot instantiate trait Baz
Error: Cannot declare self-referencing constant Abc::BAR
4 changes: 2 additions & 2 deletions ext/opcache/tests/issue0057.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ function dummy($query) {
try {
dummy(0);
} catch (Exception $e) {
echo $e->getMessage();
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
exception
Exception: exception
1 change: 0 additions & 1 deletion ext/opcache/tests/jit/add_011.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,3 @@ Warning: Undefined variable $u in %sadd_011.php on line 5

Warning: The float %f is not representable as an int, cast occurred in %sadd_011.php on line 5
int(66572500992)

2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/add_012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ $y[$x] += 4467793343;
?>
DONE
--EXPECT--
DONE
DONE
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/add_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ function y(){
?>
DONE
--EXPECT--
DONE
DONE
4 changes: 2 additions & 2 deletions ext/opcache/tests/jit/add_014.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
echo $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Bit shift by negative number
ArithmeticError: Bit shift by negative number
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/add_015.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ function test() {
?>
DONE
--EXPECT--
DONE
DONE
1 change: 0 additions & 1 deletion ext/opcache/tests/jit/assign_018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ foo();
int(2)
array(0) {
}

4 changes: 2 additions & 2 deletions ext/opcache/tests/jit/assign_040.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function test() {
try {
test();
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $y in %s on line %d
Cannot assign null to reference held by property Test::$x of type string
TypeError: Cannot assign null to reference held by property Test::$x of type string
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_041.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ function test($val) {
test(0);
?>
--EXPECT--
string(1) "0"
string(1) "0"
4 changes: 2 additions & 2 deletions ext/opcache/tests/jit/assign_043.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ try {
$a = $b;
NOT_REACHED;
} catch (Exception $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Undefined variable $b
Exception: Undefined variable $b
1 change: 0 additions & 1 deletion ext/opcache/tests/jit/assign_044.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ test(false);
?>
--EXPECT--
float(INF)

1 change: 0 additions & 1 deletion ext/opcache/tests/jit/assign_045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ test(null, 1);
?>
--EXPECT--
int(1)

1 change: 0 additions & 1 deletion ext/opcache/tests/jit/assign_047.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ DONE
--EXPECTF--
Warning: Undefined variable $a in %sassign_047.php on line 5
DONE

2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_053.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Warning: Undefined variable $y in %sassign_053.php on line 7
Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7
Stack trace:
#0 {main}
thrown in %sassign_053.php on line 7
thrown in %sassign_053.php on line 7
20 changes: 10 additions & 10 deletions ext/opcache/tests/jit/assign_dim_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function foo3() {
try {
$array[] = array();
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

$array = new ArrayObject();
Expand Down Expand Up @@ -60,7 +60,7 @@ function foo4() {
try {
$array[function() {}] = 2;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($array);

Expand All @@ -74,7 +74,7 @@ function foo5() {
try {
$a[2] = 1;
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
return $a;
}
Expand Down Expand Up @@ -109,14 +109,14 @@ var_dump(false_to_array_append(false));
try {
var_dump(false_to_array_invalid_index(false));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(false_to_array_nested(false));
var_dump(false_to_array_nested_append(false));
try {
var_dump(false_to_array_nested_invalid_index(false));
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

function array_access_undef() {
Expand All @@ -141,7 +141,7 @@ array(1) {
array(0) {
}
}
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
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(2) {
Expand All @@ -160,7 +160,7 @@ array(1) {
int(1)
}
}
Cannot access offset of type Closure on array
TypeError: Cannot access offset of type Closure on array
array(1) {
[0]=>
array(2) {
Expand All @@ -179,7 +179,7 @@ array(1) {
int(1)
}
}
Cannot use a scalar value as an array
Error: Cannot use a scalar value as an array
int(1)

Deprecated: Automatic conversion of false to array is deprecated in %s
Expand All @@ -197,7 +197,7 @@ array(1) {
}

Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
Cannot access offset of type array on array
TypeError: Cannot access offset of type array on array

Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
int(1)
Expand All @@ -220,7 +220,7 @@ array(1) {
}

Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
Cannot access offset of type array on array
TypeError: Cannot access offset of type array on array

Warning: Undefined variable $undef in %s on line %d
NULL
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_dim_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ test();
?>
--EXPECTF--
Warning: Undefined variable $v in %sassign_dim_003.php on line 3
NULL
NULL
4 changes: 2 additions & 2 deletions ext/opcache/tests/jit/assign_dim_011.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ set_error_handler(function($code, $msg) use(&$my_var) {
try {
$my_var[] = "";
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECT--
Err: Automatic conversion of false to array is deprecated
Exception: Cannot use a scalar value as an array
Error: Cannot use a scalar value as an array
DONE
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_dim_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Fatal error: Uncaught Error: Undefined constant "y" in %sassign_dim_013.php:8
Stack trace:
#0 %sassign_dim_013.php(11): test()
#1 {main}
thrown in %sassign_dim_013.php on line 8
thrown in %sassign_dim_013.php on line 8
2 changes: 1 addition & 1 deletion ext/opcache/tests/jit/assign_dim_017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ function test() {
?>
DONE
--EXPECT--
DONE
DONE
Loading
Loading