3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search_array = array('first' => 1, 'second' => 4, 'third' => 3); foreach($search_array as $key => $value){ echo $key; echo $key.".adding"; $a=explode($key,"."); echo $a[0]; echo $a[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
firstfirst.adding. Warning: Undefined array key 1 in /in/JZrcF on line 9 secondsecond.adding. Warning: Undefined array key 1 in /in/JZrcF on line 9 thirdthird.adding. Warning: Undefined array key 1 in /in/JZrcF on line 9
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
firstfirst.adding. Notice: Undefined offset: 1 in /in/JZrcF on line 9 secondsecond.adding. Notice: Undefined offset: 1 in /in/JZrcF on line 9 thirdthird.adding. Notice: Undefined offset: 1 in /in/JZrcF on line 9
Output for 7.3.32 - 7.3.33
firstfirst.adding.secondsecond.adding.thirdthird.adding.

preferences:
227.83 ms | 401 KiB | 280 Q