3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $_foo = array(); public function fill(){ array_push($this->_foo, "hello"); array_push($this->_foo, "world"); } public function getFoo() { return $this->_foo; } } $foo = new Foo(); foreach($foo->getFoo() as $q){ echo $q; }

preferences:
44.71 ms | 402 KiB | 5 Q