3v4l.org

run code in 200+ PHP versions simultaneously
<?php function test() { $arr = []; return $arr[] = 'test'; } var_dump(test());
Output for 7.2.0 - 7.4.1
string(4) "test"