xref: /PHP-5.6/Zend/tests/dereference_010.phpt (revision 99c31b31)
1--TEST--
2Testing dereference in non-array values
3--FILE--
4<?php
5
6error_reporting(E_ALL);
7
8function a() {
9	return 1;
10}
11
12$a = 1;
13var_dump($a[1]);
14var_dump(a()[1]);
15
16function b() {
17	return new stdClass;
18}
19
20var_dump(b()[1]);
21
22?>
23--EXPECTF--
24NULL
25NULL
26
27Fatal error: Cannot use object of type stdClass as array in %s on line %d
28