summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_017.phpt
blob: 77fbf2d8446f7f09b81b12ccd88d3209756ef890 (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
31
32
33
34
35
36
37
38
39
40
--TEST--
Exceptions on improper usage of $this
--FILE--
<?php
abstract class C {
	abstract static function foo();
}

function foo(callable $x) {
}

try {
	C::foo();
} catch (Error $e) {
    echo $e, "\n\n";
}

try {
	foo("C::foo");
} catch (Error $e) {
    echo $e, "\n\n";
}

C::foo();
?>
--EXPECTF--
Error: Cannot call abstract method C::foo() in %s:%d
Stack trace:
#0 {main}

TypeError: Argument 1 passed to foo() must be callable, string given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo('C::foo')
#1 {main}


Fatal error: Uncaught Error: Cannot call abstract method C::foo() in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d