1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00
Files
archived-php-src/ext/standard/tests/general_functions/error_get_last.phpt
T
Máté Kocsis 36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00

37 lines
537 B
PHP

--TEST--
error_get_last() tests
--FILE--
<?php
var_dump(error_get_last());
try {
var_dump(error_get_last(true));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
var_dump(error_get_last());
$a = $b;
var_dump(error_get_last());
echo "Done\n";
?>
--EXPECTF--
NULL
error_get_last() expects exactly 0 parameters, 1 given
NULL
Warning: Undefined variable $b in %s on line %d
array(4) {
["type"]=>
int(2)
["message"]=>
string(21) "Undefined variable $b"
["file"]=>
string(%d) "%s"
["line"]=>
int(11)
}
Done