3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test1 = 'hello'; protected $test2 = 'world'; protected $test3; public function toArray() { $this->test1 = null; $this->test3 = false; $array = get_object_vars($this); return array_filter($array, 'strlen'); } } $a = new A(); print_r(array_filter(array(1,2,false,null)); exit(); print_r($a->toArray());
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.20
Parse error: syntax error, unexpected ';' in /in/fVBdo on line 26
Process exited with code 255.

preferences:
195.56 ms | 1395 KiB | 56 Q