3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $i = 0; $arr = array(); for($i = 0; $i <= 100; $i++){ $arr[$i] = rand(0, 1000); } echo 'key is $arr['.array_search(123, $arr).']'; ?>
Output for 4.3.0 - 4.3.4, 4.3.6 - 4.3.9, 4.3.11 - 4.4.0, 4.4.2 - 5.1.3, 5.1.5, 5.2.0 - 5.2.11, 5.2.13 - 5.3.1, 5.3.5 - 5.3.13, 5.3.15 - 5.3.19, 5.3.21 - 5.4.11, 5.4.14 - 5.4.25, 5.4.27 - 5.4.41, 5.4.43, 5.4.45, 5.5.2 - 5.5.33, 5.5.35 - 5.6.3, 5.6.5 - 5.6.7, 5.6.9 - 7.1.0
key is $arr[]
Output for 5.6.8
key is $arr[82]
Output for 5.4.44, 5.6.4
key is $arr[65]
Output for 5.5.0, 5.5.34
key is $arr[54]
Output for 5.5.1
key is $arr[99]
Output for 5.4.42
key is $arr[23]
Output for 5.4.26
key is $arr[0]
Output for 5.4.13
key is $arr[76]
Output for 5.4.12
key is $arr[25]
Output for 5.3.20
key is $arr[58]
Output for 5.3.4, 5.3.14
key is $arr[87]
Output for 5.3.3
key is $arr[33]
Output for 5.3.2
key is $arr[45]
Output for 5.2.12
key is $arr[20]
Output for 5.1.6
key is $arr[43]
Output for 5.1.4
key is $arr[15]
Output for 4.4.1
key is $arr[79]
Output for 4.3.10
key is $arr[88]
Output for 4.3.5
key is $arr[14]