3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Storage { private $things = array(); public function add($item) { $this->things[] = $item; } public function evaluate(Storage $container) { return $container->things; } } class A extends Storage {} $bucket = new Storage(); $bucket->add("phone"); $bucket->add("biscuits"); $bucket->add("handcream"); $basket = new A(); print_r($basket->evaluate($bucket));

preferences:
39.38 ms | 402 KiB | 5 Q