summaryrefslogtreecommitdiff
path: root/tests/lang/catchable_error_002.phpt
blob: 7cdc02c8993b231fdc8eb9e0a8e720c5a51d3eb9 (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
--TEST--
Catchable fatal error [2]
--FILE--
<?php
    class Foo {
    }

    function blah (Foo $a)
    {
    }

    function error()
    {
        $a = func_get_args();
        var_dump($a);
    }

    set_error_handler('error');

    try {
        blah (new StdClass);
    } catch (Error $ex) {
        echo $ex->getMessage(), "\n";
    }
    echo "ALIVE!\n";
?>
--EXPECTF--
Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d
ALIVE!