3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $a = [1, 2, 3, 4, 5]; public function getA() { return $this->a; } } $a = [1, 2, 3, 4, 5]; $test = new Test; $_a = $test->getA(); shuffle($a); shuffle($_a); var_dump([ 'original' => $test->getA(), 'result _a' => $_a, 'result a' => $a, ]);

preferences:
32.83 ms | 402 KiB | 5 Q