summaryrefslogtreecommitdiff
path: root/Zend/tests/methods-on-non-objects-dynamic.phpt
blob: 11c5c9f44b7d9f8094b0280658ae7787c8fdaf34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Catch method calls on non-objects with dynamic lookups
--FILE--
<?php
set_error_handler(function($code, $message) {
  static $i= 0;
  echo 'Called #'.(++$i)."\n";
});

$arr= [null, 'method'];
var_dump($arr[0]->{$arr[1]}());

$fun= function() { return null; };
var_dump($fun()->{'method'}());

echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Alive