summaryrefslogtreecommitdiff
path: root/Zend/tests/methods-on-non-objects-array-access.phpt
blob: be87457c6c35eef5829c928967f8bdc05f285a02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
Catch method calls on non-objects inside array access
--FILE--
<?php
set_error_handler(function($code, $message) {
  var_dump($code, $message);
});

$x= null;
$a= [null => 'OK'];
var_dump($a[$x->method()]);
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
string(2) "OK"
Alive