xref: /PHP-5.5/Zend/tests/dereference_014.phpt (revision eb0ba906)
1--TEST--
2Trying to create an object from dereferencing uninitialized variable
3--FILE--
4<?php
5
6error_reporting(E_ALL);
7
8class foo {
9	public $x;
10	static public $y;
11
12	public function a() {
13		return $this->x;
14	}
15
16	static public function b() {
17		return self::$y;
18	}
19}
20
21$foo = new foo;
22$h = $foo->a()[0]->a;
23var_dump($h);
24
25$h = foo::b()[1]->b;
26var_dump($h);
27
28?>
29--EXPECTF--
30Notice: Trying to get property of non-object in %s on line %d
31NULL
32
33Notice: Trying to get property of non-object in %s on line %d
34NULL
35