3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hello[0]["y:1"] = "v:a"; $hello[0]["y:2"] = "v:b"; for($i=0;$i<count($hello[0]);$i++) { echo $hello[0]["y:".$i+1]; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
v:av:b
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/E76oc on line 9 Warning: A non-numeric value encountered in /in/E76oc on line 9 Notice: Undefined offset: 1 in /in/E76oc on line 9 Warning: A non-numeric value encountered in /in/E76oc on line 9 Notice: Undefined offset: 1 in /in/E76oc on line 9
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: A non-numeric value encountered in /in/E76oc on line 9 Warning: A non-numeric value encountered in /in/E76oc on line 9
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
Warning: A non-numeric value encountered in /in/E76oc on line 9 Notice: Undefined offset: 1 in /in/E76oc on line 9 Warning: A non-numeric value encountered in /in/E76oc on line 9 Notice: Undefined offset: 1 in /in/E76oc on line 9
Output for 7.0.0 - 7.0.20
Notice: Undefined offset: 1 in /in/E76oc on line 9 Notice: Undefined offset: 1 in /in/E76oc on line 9

preferences:
147.35 ms | 405 KiB | 170 Q