3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class ClassOne{ public function fun($v) { echo $v; } } class ClassTwo{ private $v public __construct($v) { $this->v = $v; } public function secfun($v) { $method = 'fun'; $class = new ClassOne; $class->fun($this->v); } } $c = new ClassTwo; $c->secfun('asdf');
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ';' in /in/MWRv6 on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PUBLIC, expecting ',' or ';' in /in/MWRv6 on line 9
Process exited with code 255.