3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?phpclass C{ public $p; public function &__get($n) { return $this->p; }}$first = new C;$first->p = 'init';$clone = clone $first;$clone->p = $first->magic . '-x';$clone = clone $first;$clone->p = $clone->p . '-x';$clone->p = $clone->p . '-x';$clone->p = $clone->p . '-x';echo $first->v . "\n";
Output for 5.4.34
Parse error: syntax error, unexpected 'C' (T_STRING) in /in/Rjh99 on line 1
Process exited with code 255.
Output for 5.4.0 - 5.4.32
<?phpclass C{ public $p; public function &__get($n) { return $this->p; }}$first = new C;$first->p = 'init';$clone = clone $first;$clone->p = $first->magic . '-x';$clone = clone $first;$clone->p = $clone->p . '-x';$clone->p = $clone->p . '-x';$clone->p = $clone->p . '-x';echo $first->v . "\n";