3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { protected static $foo = array ( 1, 5, 9 ); public function printFoo() { print_r(self::$foo); } public function doThing() { $foos = self::$foo; $foos[] = 12; return $foos; } } $f = new foo(); $f->printFoo(); print_r($f->doThing()); $f->printFoo();

preferences:
44.08 ms | 402 KiB | 5 Q