3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public $te1; public $te2; } $tCollection = []; for($i=0;$i<10;$i++) { $tCollection[] = (new T)->te1 = random(); } var_dump($tCollection);
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/plX45 on line 11
Process exited with code 255.

preferences:
165.02 ms | 1395 KiB | 36 Q