mirror of
https://github.com/php/php-src.git
synced 2024-10-01 23:06:11 +00:00
24 lines
369 B
PHP
Executable File
24 lines
369 B
PHP
Executable File
--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
|