3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [(new stdClass)->text = "ans1", (new stdClass)->text="ans2", (new stdClass)->text="ans3"]; var_dump($arr); //$nu = [arr[0].text,arr[1].text,arr[2].text]; //var_dump($nu);
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Fatal error: Cannot use temporary expression in write context in /in/Qj9ss on line 3
Process exited with code 255.

preferences:
173.08 ms | 1395 KiB | 36 Q