summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/bug25038.phpt
blob: 5bd549fd0f04289a505ed025b722d5fa9bbd3691 (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
27
28
29
30
--TEST--
Bug #25038 (call_user_func issues warning if function throws exception)
--FILE--
<?php

function bar($x='no argument')
{
    throw new Exception("This is an exception from bar({$x}).");
}
try
{
	bar('first try');
}
catch (Exception $e)
{
	print $e->getMessage()."\n";
}
try
{
	call_user_func('bar','second try');
}
catch (Exception $e)
{
	print $e->getMessage()."\n";
}

?>
--EXPECT--
This is an exception from bar(first try).
This is an exception from bar(second try).