3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $instance = new SomeClass(); $instance->setVar("ha"); $instance->print(); class SomeClass { function setVar($var){ $this->var = $var; } function print(){ echo $var; } }
based on vbagm
Output for hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0rc3
Notice: Undefined variable: var in /in/QvIgv on line 13
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'print' (T_PRINT), expecting identifier (T_STRING) in /in/QvIgv on line 12
Process exited with code 255.