summaryrefslogtreecommitdiff
path: root/Zend/tests/dereference_010.phpt
blob: 6acda77ba84e5ea326aa7e96c00ac9a7afe4b259 (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
--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: Cannot use object of type stdClass as array in %s on line %d