xref: /PHP-7.3/Zend/tests/dereference_010.phpt (revision e97d5fab)
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: Uncaught Error: Cannot use object of type stdClass as array in %s:%d
28Stack trace:
29#0 {main}
30  thrown in %s on line %d
31