3v4l.org

run code in 300+ PHP versions simultaneously
<?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.

preferences:
169.76 ms | 1386 KiB | 60 Q