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($test->private);

preferences:
37.3 ms | 402 KiB | 5 Q