3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function takeRef(&$foo) { $foo = "this is a string now"; } class A { private int $data = 42; public function makeString() { takeRef($this->data); var_dump($this->data); } } $a = new A(); $a->makeString();
based on nG734
Output for 5.5.0 - 7.0.4
Parse error: syntax error, unexpected 'int' (T_STRING), expecting variable (T_VARIABLE) in /in/kl5e2 on line 8
Process exited with code 255.