xref: /PHP-7.4/Zend/tests/result_unused.phpt (revision d679f022)
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--EXPECTF--
27Notice: Uninitialized string offset: 3 in %sresult_unused.php on line %d
28ok
29