3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { private $properties; public function doSomething($passed=NULL) { Test::create('test', 'test', 'test'); } public static function create($id /* [ $arg, ... */) { $arguments = func_get_args(); $command = new self($arguments); $res = new static($command, $this->properties); var_dump($res); } } $test = new Test(); $test->doSomething();
Output for 7.1.0 - 7.2.8
Fatal error: Uncaught Error: Using $this when not in object context in /in/DT8sL:10 Stack trace: #0 /in/DT8sL(5): Test::create('test', 'test', 'test') #1 /in/DT8sL(17): Test->doSomething() #2 {main} thrown in /in/DT8sL on line 10
Process exited with code 255.
Output for 5.3.0 - 7.0.20
object(Test)#3 (1) { ["properties":"Test":private]=> NULL }
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/DT8sL on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/DT8sL on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/DT8sL on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/DT8sL on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/DT8sL on line 3
Process exited with code 255.