xref: /PHP-5.6/tests/classes/static_this.phpt (revision 610c7fbe)
1--TEST--
2ZE2 $this can be an argument to a static function
3--FILE--
4<?php
5
6class TestClass
7{
8	function __construct()
9	{
10		self::Test1();
11		$this->Test1();
12	}
13
14	static function Test1()
15	{
16		var_dump($this);
17	}
18
19	static function Test2($this)
20	{
21		var_dump($this);
22	}
23}
24
25$obj = new TestClass;
26TestClass::Test2(new stdClass);
27
28?>
29===DONE===
30--EXPECTF--
31
32Notice: Undefined variable: this in %sstatic_this.php on line %d
33NULL
34
35Notice: Undefined variable: this in %sstatic_this.php on line %d
36NULL
37object(stdClass)#%d (0) {
38}
39===DONE===
40