xref: /PHP-8.3/Zend/tests/result_unused.phpt (revision 7aacc705)
1--TEST--
2Unused result of fetch operations
3--FILE--
4<?php
5$x = array(1);
6$a = "x";
7$$a;
8
9$x = array(array(2));
10$x[0];
11
12$x = "str";
13$x[0];
14$x[3];
15
16class Foo {
17    public $prop = array(3);
18    function __get($name) {
19        return array(4);
20    }
21}
22$x = new Foo();
23$x->prop;
24$x->y;
25echo "ok\n";
26?>
27--EXPECTF--
28Warning: Uninitialized string offset 3 in %s on line %d
29ok
30