3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $k = 1; class first { private $variable = 10; function get() { return $this->variable; } } $first = new first(); $c = &$first->get(); var_dump($first->get(), $c); $c = 15; var_dump($first->get(), $c);
Output for 7.0.0 - 7.2.0
Notice: Only variables should be assigned by reference in /in/SZ4NV on line 12 int(10) int(10) int(10) int(15)
Output for 5.3.22 - 5.6.28
Strict Standards: Only variables should be assigned by reference in /in/SZ4NV on line 12 int(10) int(10) int(10) int(15)