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)) { $array[] = substr($str, $pos + 1, $pos2 - $pos - 1); $str = substr($str, $pos2); } else { $array[] = substr($str, $pos + 1); $str = ''; } } } while ($pos !== false && $str); } var_dump($array, microtime(true) - $time);
Output for 7.1.0
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.017235994338989)
Output for 7.0.14
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.01879096031189)
Output for 7.0.10
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.011777877807617)
Output for 7.0.9
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.012491941452026)
Output for 7.0.8
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.013394117355347)
Output for 7.0.7
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.013763904571533)
Output for 7.0.6
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.01252293586731)
Output for 7.0.5
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.012245893478394)
Output for 7.0.4
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.012529850006104)
Output for 7.0.3
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.013458967208862)
Output for 7.0.2
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.013720035552979)
Output for 7.0.1
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.012099981307983)
Output for 7.0.0
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.014112949371338)
Output for hhvm-3.12.0
array(2) { [0]=> string(15) "SCRIPT_FILENAME" [1]=> string(11) "SCRIPT_NAME" } float(0.038577079772949)
Output for hhvm-3.10.0
array(2) { [0]=> string(15) "SCRIPT_FILENAME" [1]=> string(11) "SCRIPT_NAME" } float(0.047781944274902)
Output for 5.6.28
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.054788827896118)
Output for 5.6.25
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030148029327393)
Output for 5.6.24
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038167953491211)
Output for 5.6.23
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04324197769165)
Output for 5.6.22
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038110971450806)
Output for 5.6.21
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038052082061768)
Output for 5.6.20
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043291091918945)
Output for 5.6.19
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044935941696167)
Output for 5.6.18
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044991970062256)
Output for 5.6.17
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040860176086426)
Output for 5.6.16
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034954071044922)
Output for 5.6.15
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039168119430542)
Output for 5.6.14
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03073787689209)
Output for 5.6.13
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037719964981079)
Output for 5.6.12
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034458875656128)
Output for 5.6.11
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04039192199707)
Output for 5.6.10
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.028375148773193)
Output for 5.6.9
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03630805015564)
Output for 5.6.8
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044878959655762)
Output for 5.6.7
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037354946136475)
Output for 5.6.6
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044356107711792)
Output for 5.6.5
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043735980987549)
Output for 5.6.4
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037230014801025)
Output for 5.6.3
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038323879241943)
Output for 5.6.2
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044569969177246)
Output for 5.6.1
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043855905532837)
Output for 5.6.0
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030068159103394)
Output for 5.5.38
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039368152618408)
Output for 5.5.37
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035846948623657)
Output for 5.5.36
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046496868133545)
Output for 5.5.35
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039006948471069)
Output for 5.5.34
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039518117904663)
Output for 5.5.33
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045660972595215)
Output for 5.5.32
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042954921722412)
Output for 5.5.31
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045572996139526)
Output for 5.5.30
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.047696828842163)
Output for 5.5.29
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.046274185180664)
Output for 5.5.28
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037925004959106)
Output for 5.5.27
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.036636114120483)
Output for 5.5.26
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045386075973511)
Output for 5.5.25
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038869857788086)
Output for 5.5.24
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045133113861084)
Output for 5.5.23
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043389081954956)
Output for 5.5.22
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042135953903198)
Output for 5.5.21
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039688110351562)
Output for 5.5.20
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045268058776855)
Output for 5.5.19
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039354085922241)
Output for 5.5.18
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044445991516113)
Output for 5.5.16
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034808158874512)
Output for 5.5.15
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040838003158569)
Output for 5.5.14
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030480861663818)
Output for 5.5.13
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031335830688477)
Output for 5.5.12
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038049936294556)
Output for 5.5.11
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041626930236816)
Output for 5.5.10
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030864000320435)
Output for 5.5.9
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.0330970287323)
Output for 5.5.8
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037152051925659)
Output for 5.5.7
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033895015716553)
Output for 5.5.6
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030011892318726)
Output for 5.5.5
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040467023849487)
Output for 5.5.4
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042155027389526)
Output for 5.5.3
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04668116569519)
Output for 5.5.2
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029908895492554)
Output for 5.5.1
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030241966247559)
Output for 5.5.0
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.038016080856323)
Output for 5.4.45
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040859937667847)
Output for 5.4.44
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041165113449097)
Output for 5.4.43
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.036133050918579)
Output for 5.4.42
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041635990142822)
Output for 5.4.41
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.042986154556274)
Output for 5.4.40
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.045546054840088)
Output for 5.4.39
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041333198547363)
Output for 5.4.38
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040549039840698)
Output for 5.4.37
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033216953277588)
Output for 5.4.36
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041929960250854)
Output for 5.4.35
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04105806350708)
Output for 5.4.34
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041943073272705)
Output for 5.4.32
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029613018035889)
Output for 5.4.31
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037263154983521)
Output for 5.4.30
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030747890472412)
Output for 5.4.29
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029435873031616)
Output for 5.4.28
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029926061630249)
Output for 5.4.27
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029830932617188)
Output for 5.4.26
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04150390625)
Output for 5.4.25
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.044338941574097)
Output for 5.4.24
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03376293182373)
Output for 5.4.23
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.032174110412598)
Output for 5.4.22
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029834985733032)
Output for 5.4.21
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039015054702759)
Output for 5.4.20
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.04101300239563)
Output for 5.4.19
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.040884017944336)
Output for 5.4.18
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.036751985549927)
Output for 5.4.17
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037089109420776)
Output for 5.4.16
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.02987813949585)
Output for 5.4.15
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030028104782104)
Output for 5.4.14
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.035212993621826)
Output for 5.4.13
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.029546022415161)
Output for 5.4.12
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034789085388184)
Output for 5.4.11
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03003191947937)
Output for 5.4.10
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.03014612197876)
Output for 5.4.9
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.037929058074951)
Output for 5.4.8
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039965867996216)
Output for 5.4.7
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.030280113220215)
Output for 5.4.6
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.033641815185547)
Output for 5.4.5
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.031471014022827)
Output for 5.4.4
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.049134016036987)
Output for 5.4.3
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.043313980102539)
Output for 5.4.2
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.034295082092285)
Output for 5.4.1
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.039470911026001)
Output for 5.4.0
array(2) { [0]=> string(11) "SCRIPT_NAME" [1]=> string(15) "SCRIPT_FILENAME" } float(0.041817903518677)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/95k1c 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/95k1c on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/95k1c on line 6
Process exited with code 255.