3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $test1 = 'hello'; protected $test2 = 'world'; public function toArray() { $this->test1 = 'sadghsa'; return get_object_vars($this); } } $a = new A(); print_r($a->toArray());

preferences:
39.53 ms | 402 KiB | 5 Q