3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.28, 5.4.0 - 5.4.31
Parse error: syntax error, unexpected '}' in /in/gQAbD on line 19
Process exited with code 255.

preferences:
201.25 ms | 1395 KiB | 68 Q