1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 18:13:00 +02:00
Files
archived-php-src/Zend/tests/errmsg_045.phpt
Máté Kocsis 36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00

21 lines
574 B
PHP

--TEST--
Error message in error handler during compilation
--FILE--
<?php
set_error_handler(function($_, $msg, $file) {
var_dump($msg, $file);
echo $undefined;
});
/* This is just a particular example of a non-fatal compile-time error
* If this breaks in future, just find another example and use it instead */
eval('class A { private function __invoke() { } }');
?>
--EXPECTF--
string(76) "The magic method __invoke() must have public visibility and cannot be static"
string(%d) "%s(%d) : eval()'d code"
Warning: Undefined variable $undefined in %s on line %d