3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time = microtime(true); for ($i = 0; $i < 10000; $i++) { $array = []; $str = '|' . implode('|', array_keys($_SERVER)); do { if (false !== $pos = strpos($str, '|SCRIPT_')) { if (false !== $pos2 = strpos($str, '|', $pos + 1)) { $len = $pos2 - $pos - 1; } else { $len = null; } $array[] = substr($str, $pos + 1, $len); $str = $pos2 !== false ? substr($str, $pos2) : ''; } } while ($pos !== false && $str); } var_dump(count($_SERVER), $array, microtime(true) - $time);
based on BOMTW
Output for 7.1.0
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.018710851669312)
Output for 7.0.14
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.019536972045898)
Output for 7.0.8
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.0090489387512207)
Output for 7.0.7
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.010231018066406)
Output for 7.0.6
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.008944034576416)
Output for 7.0.5
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.010648965835571)
Output for 7.0.4
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.012176036834717)
Output for 7.0.3
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.014893054962158)
Output for 7.0.2
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.01442289352417)
Output for 7.0.1
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.011523008346558)
Output for 7.0.0
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.011805057525635)
Output for hhvm-3.12.0
int(21) array(2) { [0]=> string(15) "SCRIPT_FILENAME" [1]=> string(11) "SCRIPT_NAME" } float(0.024219989776611)
Output for hhvm-3.10.0
int(21) array(2) { [0]=> string(15) "SCRIPT_FILENAME" [1]=> string(11) "SCRIPT_NAME" } float(0.029021024703979)
Output for 5.6.28
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.056219100952148)
Output for 5.6.23
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038531064987183)
Output for 5.6.22
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044742107391357)
Output for 5.6.21
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042700052261353)
Output for 5.6.20
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031800985336304)
Output for 5.6.19
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039769887924194)
Output for 5.6.18
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043156862258911)
Output for 5.6.17
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038071155548096)
Output for 5.6.16
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041903018951416)
Output for 5.6.15
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034986972808838)
Output for 5.6.14
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.036255836486816)
Output for 5.6.13
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.036458015441895)
Output for 5.6.12
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043973922729492)
Output for 5.6.11
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046188116073608)
Output for 5.6.10
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035834789276123)
Output for 5.6.9
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031294107437134)
Output for 5.6.8
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040021896362305)
Output for 5.6.7
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037595987319946)
Output for 5.6.6
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044191122055054)
Output for 5.6.5
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031905174255371)
Output for 5.6.4
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039705038070679)
Output for 5.6.3
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042098045349121)
Output for 5.6.2
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040557861328125)
Output for 5.6.1
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.0430908203125)
Output for 5.6.0
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035902976989746)
Output for 5.5.37
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045580148696899)
Output for 5.5.36
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035873174667358)
Output for 5.5.35
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.048785924911499)
Output for 5.5.34
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039295196533203)
Output for 5.5.33
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042109966278076)
Output for 5.5.32
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041246891021729)
Output for 5.5.31
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037111043930054)
Output for 5.5.30
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037414073944092)
Output for 5.5.29
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041546106338501)
Output for 5.5.28
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.032116174697876)
Output for 5.5.27
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.0450279712677)
Output for 5.5.26
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040662050247192)
Output for 5.5.25
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037839889526367)
Output for 5.5.24
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037749052047729)
Output for 5.5.23
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044939994812012)
Output for 5.5.22
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035288095474243)
Output for 5.5.21
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039826154708862)
Output for 5.5.20
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043699026107788)
Output for 5.5.19
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.036534070968628)
Output for 5.5.18
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033473968505859)
Output for 5.5.16
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031126022338867)
Output for 5.5.15
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030546903610229)
Output for 5.5.14
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044504880905151)
Output for 5.5.13
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.047361850738525)
Output for 5.5.12
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042146921157837)
Output for 5.5.11
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033419132232666)
Output for 5.5.10
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044080018997192)
Output for 5.5.9
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031229019165039)
Output for 5.5.8
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046416997909546)
Output for 5.5.7
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046808004379272)
Output for 5.5.6
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046195030212402)
Output for 5.5.5
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040221929550171)
Output for 5.5.4
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046432971954346)
Output for 5.5.3
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039736986160278)
Output for 5.5.2
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046700000762939)
Output for 5.5.1
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046875)
Output for 5.5.0
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045752048492432)
Output for 5.4.45
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039838075637817)
Output for 5.4.44
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038900136947632)
Output for 5.4.43
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033499002456665)
Output for 5.4.42
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040479898452759)
Output for 5.4.41
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045690059661865)
Output for 5.4.40
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041620016098022)
Output for 5.4.39
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034328937530518)
Output for 5.4.38
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.054079055786133)
Output for 5.4.37
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037944078445435)
Output for 5.4.36
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03627610206604)
Output for 5.4.35
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042176008224487)
Output for 5.4.34
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.032505989074707)
Output for 5.4.32
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034768104553223)
Output for 5.4.31
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03788685798645)
Output for 5.4.30
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029720067977905)
Output for 5.4.29
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04732608795166)
Output for 5.4.28
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041110992431641)
Output for 5.4.27
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046128988265991)
Output for 5.4.26
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03520393371582)
Output for 5.4.25
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040273189544678)
Output for 5.4.24
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.032660007476807)
Output for 5.4.23
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040208101272583)
Output for 5.4.22
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044817924499512)
Output for 5.4.21
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045161008834839)
Output for 5.4.20
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039519071578979)
Output for 5.4.19
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030472040176392)
Output for 5.4.18
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04768705368042)
Output for 5.4.17
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.02961802482605)
Output for 5.4.16
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030327081680298)
Output for 5.4.15
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038449048995972)
Output for 5.4.14
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037117958068848)
Output for 5.4.13
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035957098007202)
Output for 5.4.12
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04081392288208)
Output for 5.4.11
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030344009399414)
Output for 5.4.10
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.032206058502197)
Output for 5.4.9
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029799938201904)
Output for 5.4.8
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029613971710205)
Output for 5.4.7
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.028479099273682)
Output for 5.4.6
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.027868032455444)
Output for 5.4.5
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.048521995544434)
Output for 5.4.4
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033908843994141)
Output for 5.4.3
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029857158660889)
Output for 5.4.2
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030586957931519)
Output for 5.4.1
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045774936676025)
Output for 5.4.0
int(18) array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03438401222229)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/GknrR on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/GknrR on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/GknrR on line 6
Process exited with code 255.