xref: /PHP-7.2/tests/classes/static_this.phpt (revision a9512af8)
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--
31Fatal error: Cannot use $this as parameter in %sstatic_this.php on line 16
32