summaryrefslogtreecommitdiff
path: root/Zend/tests/dereference_014.phpt
blob: 859ac9334805cc63d637700d1b901814b9792e57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Trying to create an object from dereferencing uninitialized variable
--FILE--
<?php

error_reporting(E_ALL);

class foo {
	public $x;
	static public $y;
		
	public function a() {
		return $this->x;
	}
	
	static public function b() {
		return self::$y;
	}
}

$foo = new foo;
$h = $foo->a()[0]->a;
var_dump($h);

$h = foo::b()[1]->b;
var_dump($h);

?>
--EXPECTF--
Notice: Trying to get property 'a' of non-object in %s on line %d
NULL

Notice: Trying to get property 'b' of non-object in %s on line %d
NULL