mirror of
https://github.com/php/php-src.git
synced 2026-10-29 02:07:35 +08:00
Add directories for tests relating to - `break` statements - functions with by-ref returns - `class_exists()` - dynamic properties - error handlers - error suppression with `@` - `get_object_vars()` - `highlight_string()` and `highlight_file()` - interfaces - `is_callable()` - iterators - shutdown functions - streams As well as organizing a couple of tests into existing sub directories along the way Work towards GH-15631
27 lines
561 B
PHP
27 lines
561 B
PHP
--TEST--
|
|
Bug #70689 (Exception handler does not work as expected)
|
|
--FILE--
|
|
<?php
|
|
|
|
function foo($foo) {
|
|
echo "Executing foo\n";
|
|
}
|
|
|
|
set_error_handler(function($errno, $errstr) {
|
|
throw new Exception($errstr);
|
|
});
|
|
|
|
try {
|
|
foo();
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
|
|
Stack trace:
|
|
#0 %sbug70689.php(12): foo()
|
|
#1 {main}
|
|
thrown in %sbug70689.php on line 3
|