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,$o->PlusOne());// 126?
Output for 5.4.0 - 5.4.23
Fatal error: Call-time pass-by-reference has been removed in /in/p0bKq on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Deprecated: Call-time pass-by-reference has been deprecated in /in/p0bKq on line 15 Parse error: syntax error, unexpected '=', expecting ')' in /in/p0bKq on line 15
Process exited with code 255.