3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export($array['does']['not']['exist'] ?? 'nope'); echo "\n---\n"; var_export($obj->does->not->exist ?? 'nope'); echo "\n---\n"; var_export($obj->does[123]->not->exist[678]['foo'] ?? 'nope');
Output for 7.1.33, 7.3.10, 7.4.33, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
'nope' --- 'nope' --- 'nope'
Output for 5.6.40
Parse error: syntax error, unexpected '?' in /in/pAdoF on line 3
Process exited with code 255.

preferences:
70.45 ms | 406 KiB | 5 Q