summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70689.phpt
blob: 882dd89b75c96977a9ec2a6d6888b109e84300f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--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