summaryrefslogtreecommitdiff
path: root/Zend/tests/methods-on-non-objects-nested-calls-static.phpt
blob: 64972ee871b18737bc275f37deb8203fd31c084f (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
--TEST--
Catch method calls on non-objects with nested calls to static methods
--FILE--
<?php
class Nesting {
  static function nested() {
    throw new LogicException('Should not be called');
  }
}
set_error_handler(function($code, $message) {
  static $i= 0;
  echo 'Called #'.(++$i)."\n";
});

$x= null;
$class= 'Nesting';
$method= 'nested';
var_dump($x->method(Nesting::nested()));
var_dump($x->method($class::nested()));
var_dump($x->method($class::{$method}()));
var_dump($x->method([Nesting::nested()]));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Alive