3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a{ $u = 'u'; function getClass(){ echo get_class($this) ; } } class b extends a{ public $u = 'b'; } $b = new b(); $b->getClass();
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '$u' (T_VARIABLE), expecting function (T_FUNCTION) in /in/sCSOA on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/sCSOA on line 5
Process exited with code 255.