3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { public memvar; public function __construct($a=1) { $a += 100; $this->memvar = ++$a; } public function PlusOne { return $this->$memvar; } } $o = new test($a=25); var_dump($a);// 126?
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected 'memvar' (T_STRING), expecting variable (T_VARIABLE) in /in/ekFNH on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/ekFNH on line 3
Process exited with code 255.