3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $private = ""; public function add($string) { $this->private[] = $string; } public function evaluate(Test $container) { return $container->private; } } $test = new Test(); $test->add("zero"); $test->add("one"); $test->add("two"); $result = new Test(); print_r($result->evaluate($test));

preferences:
34.37 ms | 404 KiB | 5 Q