summaryrefslogtreecommitdiff
path: root/Zend/tests/dereference_010.phpt
blob: ec62e5614ebf02a9c0619a3cefe3245a21928d9a (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
--TEST--
Testing dereference in non-array values
--FILE--
<?php

error_reporting(E_ALL);

function a() {
	return 1;
}

$a = 1;
var_dump($a[1]);
var_dump(a()[1]);

function b() {
	return new stdClass;
}

var_dump(b()[1]);

?>
--EXPECTF--
NULL
NULL

Fatal error: Uncaught EngineException: Cannot use object of type stdClass as array in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d