3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Xpto{ private $someArray = array(); public function __set($parameter, $value) { $this->someArray[$parameter] = $value; } public function __get($parameter) { return $this->someArray[$parameter]; } public function getAll() { return $this->someArray() } } $class = new Xpto(); $class->test = "uma variavel com test\n"; echo $class->test; print_r( $class->getAll() );
Output for 5.3.0 - 5.4.31
Parse error: syntax error, unexpected '}' in /in/gQAbD on line 19
Process exited with code 255.