3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = '1|27|31|33'; $separator = '##|##'; $iterations = 1000000; $time = microtime(true); var_dump($time); for ($i = 0; $i < $iterations; $i++) { $result = str_replace('|', $separator, $input); } $time1 = microtime(true); echo 'processed in ' . (($time1 - $time) * 1000) . ' millisecs'; for ($i = 0; $i < $iterations; $i++) { $result = ''; $it = new CachingIterator(new ArrayIterator(explode('|', $input)), CachingIterator::FULL_CACHE); foreach ($it as $categoryId) { $result .= $categoryId; if ($it->hasNext()) { $result .= $separator; } } } $time2 = microtime(true); echo 'processed in ' . (($time2 - $time1) * 1000) . ' millisecs';
Output for 7.1.0
float(1382714296.0048) processed in 136.05093955994 millisecsprocessed in 2047.699213028 millisecs
Output for 7.0.14
float(1382714296.0039) processed in 165.40384292603 millisecs
Process exited with code 137.
Output for 7.0.10
float(1382714296.0039) processed in 107.81288146973 millisecsprocessed in 1741.3220405579 millisecs
Output for 7.0.9
float(1382714296.0039) processed in 118.79992485046 millisecsprocessed in 1674.5219230652 millisecs
Output for 7.0.8
float(1382714296.0029) processed in 112.02812194824 millisecsprocessed in 1660.4428291321 millisecs
Output for 7.0.7
float(1382714296.0034) processed in 109.72499847412 millisecsprocessed in 1735.5990409851 millisecs
Output for 7.0.6
float(1382714296.0024) processed in 99.653005599976 millisecsprocessed in 2122.6780414581 millisecs
Output for 7.0.5
float(1382714296.0034) processed in 114.73703384399 millisecsprocessed in 1778.3000469208 millisecs
Output for 7.0.4
float(1382714296.0038) processed in 135.95390319824 millisecsprocessed in 1792.0551300049 millisecs
Output for 7.0.3
float(1382714296.004) processed in 141.14999771118 millisecsprocessed in 1801.3780117035 millisecs
Output for 7.0.2
float(1382714296.0035) processed in 123.57997894287 millisecsprocessed in 1660.0630283356 millisecs
Output for 7.0.1
float(1382714296.0021) processed in 85.008859634399 millisecsprocessed in 1681.1311244965 millisecs
Output for 7.0.0
float(1382714296.0026) processed in 104.98094558716 millisecsprocessed in 1741.6770458221 millisecs
Output for hhvm-3.12.0
float(1382714296.1972) processed in 278.12504768372 millisecs
Process exited with code 137.
Output for hhvm-3.10.0
float(1382714296.3801) processed in 610.25190353394 millisecs
Process exited with code 137.
Output for 5.6.28
float(1382714296.0045) processed in 102.25987434387 millisecs
Process exited with code 137.
Output for 5.6.25
float(1382714296.0044) processed in 244.32706832886 millisecs
Process exited with code 137.
Output for 5.6.24
float(1382714296.0045) processed in 277.56190299988 millisecs
Process exited with code 137.
Output for 5.6.23
float(1382714296.0051) processed in 262.20917701721 millisecs
Process exited with code 137.
Output for 5.6.22
float(1382714296.0026) processed in 233.75701904297 millisecs
Process exited with code 137.
Output for 5.6.21
float(1382714296.004) processed in 249.03106689453 millisecs
Process exited with code 137.
Output for 5.6.20
float(1382714296.0038) processed in 258.17513465881 millisecs
Process exited with code 137.
Output for 5.6.19
float(1382714296.0037) processed in 250.71907043457 millisecs
Process exited with code 137.
Output for 5.6.18
float(1382714296.0048) processed in 265.79999923706 millisecs
Process exited with code 137.
Output for 5.6.17
float(1382714296.0046) processed in 244.34685707092 millisecs
Process exited with code 137.
Output for 5.6.16
float(1382714296.0032) processed in 235.1131439209 millisecs
Process exited with code 137.
Output for 5.6.15
float(1382714296.0037) processed in 248.08979034424 millisecs
Process exited with code 137.
Output for 5.6.14
float(1382714296.0039) processed in 237.13111877441 millisecs
Process exited with code 137.
Output for 5.6.13
float(1382714296.0029) processed in 243.29090118408 millisecs
Process exited with code 137.
Output for 5.6.12
float(1382714296.0041) processed in 242.44999885559 millisecs
Process exited with code 137.
Output for 5.6.11
float(1382714296.0046) processed in 270.76888084412 millisecs
Process exited with code 137.
Output for 5.6.10
float(1382714296.003) processed in 254.14299964905 millisecs
Process exited with code 137.
Output for 5.6.9
float(1382714296.0044) processed in 255.75804710388 millisecs
Process exited with code 137.
Output for 5.6.8
float(1382714296.004) processed in 234.38215255737 millisecs
Process exited with code 137.
Output for 5.6.7
float(1382714296.0028) processed in 213.13810348511 millisecs
Process exited with code 137.
Output for 5.6.6
float(1382714296.0046) processed in 254.5120716095 millisecs
Process exited with code 137.
Output for 5.6.5
float(1382714296.0041) processed in 245.50604820251 millisecs
Process exited with code 137.
Output for 5.6.4
float(1382714296.0037) processed in 253.25989723206 millisecs
Process exited with code 137.
Output for 5.6.3
float(1382714296.0038) processed in 246.56009674072 millisecs
Process exited with code 137.
Output for 5.6.2
float(1382714296.0046) processed in 244.84086036682 millisecs
Process exited with code 137.
Output for 5.6.1
float(1382714296.0035) processed in 222.95999526978 millisecs
Process exited with code 137.
Output for 5.6.0
float(1382714296.0046) processed in 251.06191635132 millisecs
Process exited with code 137.
Output for 5.5.38
float(1382714296.0044) processed in 255.04803657532 millisecs
Process exited with code 137.
Output for 5.5.37
float(1382714296.0047) processed in 372.08890914917 millisecs
Process exited with code 137.
Output for 5.5.36
float(1382714296.0042) processed in 246.40393257141 millisecs
Process exited with code 137.
Output for 5.5.35
float(1382714296.0048) processed in 501.17301940918 millisecs
Process exited with code 137.
Output for 5.5.34
float(1382714296.0072) processed in 655.46703338623 millisecs
Process exited with code 137.
Output for 5.5.33
float(1382714296.005) processed in 375.31399726868 millisecs
Process exited with code 137.
Output for 5.5.32
float(1382714296.0043) processed in 293.16997528076 millisecs
Process exited with code 137.
Output for 5.5.31
float(1382714296.0047) processed in 386.71684265137 millisecs
Process exited with code 137.
Output for 5.5.30
float(1382714296.0047) processed in 423.36821556091 millisecs
Process exited with code 137.
Output for 5.5.29
float(1382714296.0048) processed in 411.98801994324 millisecs
Process exited with code 137.
Output for 5.5.28
float(1382714296.005) processed in 371.40083312988 millisecs
Process exited with code 137.
Output for 5.5.27
float(1382714296.0039) processed in 268.76592636108 millisecs
Process exited with code 137.
Output for 5.5.26
float(1382714296.0043) processed in 266.04986190796 millisecs
Process exited with code 137.
Output for 5.5.25
float(1382714296.0038) processed in 262.56799697876 millisecs
Process exited with code 137.
Output for 5.5.24
float(1382714296.0047) processed in 380.20706176758 millisecs
Process exited with code 137.
Output for 5.5.23
float(1382714296.0059) processed in 441.55216217041 millisecs
Process exited with code 137.
Output for 5.5.22
float(1382714296.0029) processed in 244.39477920532 millisecs
Process exited with code 137.
Output for 5.5.21
float(1382714296.004) processed in 256.60014152527 millisecs
Process exited with code 137.
Output for 5.5.20
float(1382714296.0045) processed in 291.68701171875 millisecs
Process exited with code 137.
Output for 5.5.19
float(1382714296.0045) processed in 281.81910514832 millisecs
Process exited with code 137.
Output for 5.5.18
float(1382714296.0038) processed in 262.65907287598 millisecs
Process exited with code 137.
Output for 5.5.16
float(1382714296.0029) processed in 240.1340007782 millisecs
Process exited with code 137.
Output for 5.5.15
float(1382714296.0028) processed in 228.05404663086 millisecs
Process exited with code 137.
Output for 5.5.14
float(1382714296.0043) processed in 268.81194114685 millisecs
Process exited with code 137.
Output for 5.5.13
float(1382714296.0042) processed in 259.09304618835 millisecs
Process exited with code 137.
Output for 5.5.12
float(1382714296.005) processed in 453.51195335388 millisecs
Process exited with code 137.
Output for 5.5.11
float(1382714296.0049) processed in 446.98810577393 millisecs
Process exited with code 137.
Output for 5.5.10
float(1382714296.0035) processed in 286.32998466492 millisecs
Process exited with code 137.
Output for 5.5.9
float(1382714296.0042) processed in 290.60411453247 millisecs
Process exited with code 137.
Output for 5.5.8
float(1382714296.0045) processed in 404.61897850037 millisecs
Process exited with code 137.
Output for 5.5.7
float(1382714296.0046) processed in 395.35403251648 millisecs
Process exited with code 137.
Output for 5.5.6
float(1382714296.0029) processed in 231.23097419739 millisecs
Process exited with code 137.
Output for 5.5.5
float(1382714296.0031) processed in 214.30015563965 millisecs
Process exited with code 137.
Output for 5.5.4
float(1382714296.0047) processed in 387.77995109558 millisecs
Process exited with code 137.
Output for 5.5.3
float(1382714296.0045) processed in 276.32212638855 millisecs
Process exited with code 137.
Output for 5.5.2
float(1382714296.005) processed in 405.54189682007 millisecs
Process exited with code 137.
Output for 5.5.1
float(1382714296.0047) processed in 281.78882598877 millisecs
Process exited with code 137.
Output for 5.5.0
float(1382714296.0068) processed in 389.00780677795 millisecs
Process exited with code 137.
Output for 5.4.45
float(1382714296.0039) processed in 270.08485794067 millisecs
Process exited with code 137.
Output for 5.4.44
float(1382714296.0035) processed in 242.18106269836 millisecs
Process exited with code 137.
Output for 5.4.43
float(1382714296.0031) processed in 239.56799507141 millisecs
Process exited with code 137.
Output for 5.4.42
float(1382714296.0033) processed in 251.70397758484 millisecs
Process exited with code 137.
Output for 5.4.41
float(1382714296.0043) processed in 493.56079101562 millisecs
Process exited with code 137.
Output for 5.4.40
float(1382714296.0038) processed in 266.23201370239 millisecs
Process exited with code 137.
Output for 5.4.39
float(1382714296.0036) processed in 240.29397964478 millisecs
Process exited with code 137.
Output for 5.4.38
float(1382714296.0046) processed in 512.56108283997 millisecs
Process exited with code 137.
Output for 5.4.37
float(1382714296.0061) processed in 421.6468334198 millisecs
Process exited with code 137.
Output for 5.4.36
float(1382714296.003) processed in 247.29800224304 millisecs
Process exited with code 137.
Output for 5.4.35
float(1382714296.0038) processed in 354.63094711304 millisecs
Process exited with code 137.
Output for 5.4.34
float(1382714296.0042) processed in 279.52599525452 millisecs
Process exited with code 137.
Output for 5.4.32
float(1382714296.0038) processed in 371.04487419128 millisecs
Process exited with code 137.
Output for 5.4.31
float(1382714296.0039) processed in 442.44909286499 millisecs
Process exited with code 137.
Output for 5.4.30
float(1382714296.0039) processed in 251.54399871826 millisecs
Process exited with code 137.
Output for 5.4.29
float(1382714296.0032) processed in 257.54690170288 millisecs
Process exited with code 137.
Output for 5.4.28
float(1382714296.004) processed in 253.73816490173 millisecs
Process exited with code 137.
Output for 5.4.27
float(1382714296.0043) processed in 377.2189617157 millisecs
Process exited with code 137.
Output for 5.4.26
float(1382714296.004) processed in 255.59711456299 millisecs
Process exited with code 137.
Output for 5.4.25
float(1382714296.0037) processed in 382.3938369751 millisecs
Process exited with code 137.
Output for 5.4.24
float(1382714296.0028) processed in 298.24900627136 millisecs
Process exited with code 137.
Output for 5.4.23
float(1382714296.0037) processed in 265.58089256287 millisecs
Process exited with code 137.
Output for 5.4.22
float(1382714296.004) processed in 357.69295692444 millisecs
Process exited with code 137.
Output for 5.4.21
float(1382714296.0042) processed in 375.51093101501 millisecs
Process exited with code 137.
Output for 5.4.20
float(1382714296.0055) processed in 374.76587295532 millisecs
Process exited with code 137.
Output for 5.4.19
float(1382714296.0035) processed in 233.27994346619 millisecs
Process exited with code 137.
Output for 5.4.18
float(1382714296.0041) processed in 412.95886039734 millisecs
Process exited with code 137.
Output for 5.4.17
float(1382714296.0055) processed in 394.1650390625 millisecs
Process exited with code 137.
Output for 5.4.16
float(1382714296.004) processed in 262.94016838074 millisecs
Process exited with code 137.
Output for 5.4.15
float(1382714296.0029) processed in 243.31212043762 millisecs
Process exited with code 137.
Output for 5.4.14
float(1382714296.0031) processed in 320.02592086792 millisecs
Process exited with code 137.
Output for 5.4.13
float(1382714296.0013) processed in 242.33293533325 millisecs
Process exited with code 137.
Output for 5.4.12
float(1382714296.0034) processed in 364.44497108459 millisecs
Process exited with code 137.
Output for 5.4.11
float(1382714296.0023) processed in 437.175989151 millisecs
Process exited with code 137.
Output for 5.4.10
float(1382714296.0016) processed in 240.08893966675 millisecs
Process exited with code 137.
Output for 5.4.9
float(1382714296.0027) processed in 415.27605056763 millisecs
Process exited with code 137.
Output for 5.4.8
float(1382714296.0088) processed in 502.77900695801 millisecs
Process exited with code 137.
Output for 5.4.7
float(1382714296.0035) processed in 491.07909202576 millisecs
Process exited with code 137.
Output for 5.4.6
float(1382714296.0015) processed in 243.39389801025 millisecs
Process exited with code 137.
Output for 5.4.5
float(1382714296.0025) processed in 358.72602462769 millisecs
Process exited with code 137.
Output for 5.4.4
float(1382714296.0027) processed in 289.40510749817 millisecs
Process exited with code 137.
Output for 5.4.3
float(1382714296.0035) processed in 381.44016265869 millisecs
Process exited with code 137.
Output for 5.4.2
float(1382714296.0023) processed in 269.79899406433 millisecs
Process exited with code 137.
Output for 5.4.1
float(1382714296.0033) processed in 443.37010383606 millisecs
Process exited with code 137.
Output for 5.4.0
float(1382714296.0025) processed in 361.94014549255 millisecs
Process exited with code 137.
Output for 5.3.29
float(1382714296.0024) processed in 505.34009933472 millisecs
Process exited with code 137.
Output for 5.3.28
float(1382714296.0027) processed in 512.41302490234 millisecs
Process exited with code 137.
Output for 5.3.27
float(1382714296.0029) processed in 452.31509208679 millisecs
Process exited with code 137.
Output for 5.3.26
float(1382714296.002) processed in 331.11214637756 millisecs
Process exited with code 137.
Output for 5.3.25
float(1382714296.0023) processed in 327.97002792358 millisecs
Process exited with code 137.
Output for 5.3.24
float(1382714296.0012) processed in 236.92512512207 millisecs
Process exited with code 137.
Output for 5.3.23
float(1382714296.0024) processed in 518.54991912842 millisecs
Process exited with code 137.
Output for 5.3.22
float(1382714296.0022) processed in 329.03385162354 millisecs
Process exited with code 137.
Output for 5.3.21
float(1382714296.0026) processed in 528.892993927 millisecs
Process exited with code 137.
Output for 5.3.20
float(1382714296.0024) processed in 560.78791618347 millisecs
Process exited with code 137.
Output for 5.3.19
float(1382714296.0021) processed in 328.18603515625 millisecs
Process exited with code 137.
Output for 5.3.18
float(1382714296.0022) processed in 299.29494857788 millisecs
Process exited with code 137.
Output for 5.3.17
float(1382714296.0024) processed in 529.01911735535 millisecs
Process exited with code 137.
Output for 5.3.16
float(1382714296.0029) processed in 347.3801612854 millisecs
Process exited with code 137.
Output for 5.3.15
float(1382714296.0023) processed in 522.00484275818 millisecs
Process exited with code 137.
Output for 5.3.14
float(1382714296.0031) processed in 550.91190338135 millisecs
Process exited with code 137.
Output for 5.3.13
float(1382714296.005) processed in 561.97023391724 millisecs
Process exited with code 137.
Output for 5.3.12
float(1382714296.0041) processed in 548.61903190613 millisecs
Process exited with code 137.
Output for 5.3.11
float(1382714296.0035) processed in 521.6748714447 millisecs
Process exited with code 137.
Output for 5.3.10
float(1382714296.0017) processed in 351.46903991699 millisecs
Process exited with code 137.
Output for 5.3.9
float(1382714296.0024) processed in 517.72499084473 millisecs
Process exited with code 137.
Output for 5.3.8
float(1382714296.0013) processed in 317.76881217957 millisecs
Process exited with code 137.
Output for 5.3.7
float(1382714296.0036) processed in 489.43710327148 millisecs
Process exited with code 137.
Output for 5.3.6
float(1382714296.0021) processed in 331.89988136292 millisecs
Process exited with code 137.
Output for 5.3.5
float(1382714296.0027) processed in 557.96098709106 millisecs
Process exited with code 137.
Output for 5.3.4
float(1382714296.0043) processed in 704.69307899475 millisecs
Process exited with code 137.
Output for 5.3.3
float(1382714296.0023) processed in 491.29009246826 millisecs
Process exited with code 137.
Output for 5.3.2
float(1382714296.0021) processed in 325.93083381653 millisecs
Process exited with code 137.
Output for 5.3.1
float(1382714296.0041) processed in 486.42706871033 millisecs
Process exited with code 137.
Output for 5.3.0
float(1382714296.0023) processed in 313.7378692627 millisecs
Process exited with code 137.
Output for 5.2.17
float(1382714296.0015) processed in 314.34106826782 millisecs
Process exited with code 137.
Output for 5.2.16
float(1382714296.003) processed in 682.24000930786 millisecs
Process exited with code 137.
Output for 5.2.15
float(1382714296.0019) processed in 512.94994354248 millisecs
Process exited with code 137.
Output for 5.2.14
float(1382714296.0012) processed in 306.45704269409 millisecs
Process exited with code 137.
Output for 5.2.13
float(1382714296.0019) processed in 338.99092674255 millisecs
Process exited with code 137.
Output for 5.2.12
float(1382714296.0021) processed in 543.98107528687 millisecs
Process exited with code 137.
Output for 5.2.11
float(1382714296.0013) processed in 309.4367980957 millisecs
Process exited with code 137.
Output for 5.2.10
float(1382714296.002) processed in 579.77080345154 millisecs
Process exited with code 137.
Output for 5.2.9
float(1382714296.0016) processed in 344.03514862061 millisecs
Process exited with code 137.
Output for 5.2.8
float(1382714296.002) processed in 550.53186416626 millisecs
Process exited with code 137.
Output for 5.2.7
float(1382714296.0023) processed in 586.92002296448 millisecs
Process exited with code 137.
Output for 5.2.6
float(1382714296.0017) processed in 493.25489997864 millisecs
Process exited with code 137.
Output for 5.2.5
float(1382714296.0018) processed in 530.41911125183 millisecs
Process exited with code 137.
Output for 5.2.4
float(1382714296.0019) processed in 321.91109657288 millisecs
Process exited with code 137.
Output for 5.2.3
float(1382714296.0019) processed in 527.1999835968 millisecs
Process exited with code 137.
Output for 5.2.2
float(1382714296.0011) processed in 316.1289691925 millisecs
Process exited with code 137.
Output for 5.2.1
float(1382714296.0023) processed in 485.93592643738 millisecs
Process exited with code 137.
Output for 5.2.0
float(1382714296.0018) processed in 511.76500320435 millisecs
Process exited with code 137.
Output for 5.1.6
float(1382714296.0017) processed in 328.80783081055 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.1.5
float(1382714296.0017) processed in 324.81789588928 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.1.4
float(1382714296.0016) processed in 324.85389709473 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.1.3
float(1382714296.002) processed in 324.36203956604 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.1.2
float(1382714296.0017) processed in 281.83603286743 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.1.1
float(1382714296.0016) processed in 298.46501350403 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.1.0
float(1382714296.0013) processed in 275.59900283813 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 5.0.5
float(1382714296.0005) processed in 494.34185028076 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16 Fatal error: Unknown: The inner constructor wasn't initialized with an iterator instance in Unknown on line 0
Process exited with code 255.
Output for 5.0.4
float(1382714296.0006) processed in 483.3869934082 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16 Fatal error: Unknown: The inner constructor wasn't initialized with an iterator instance in Unknown on line 0
Process exited with code 255.
Output for 5.0.3
float(1382714296.0008) processed in 449.95498657227 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16 Fatal error: Unknown: The inner constructor wasn't initialized with an iterator instance in Unknown on line 0
Process exited with code 255.
Output for 5.0.2
float(1382714296.0008) processed in 469.29287910461 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16 Fatal error: Unknown: The inner constructor wasn't initialized with an iterator instance in Unknown on line 0
Process exited with code 255.
Output for 5.0.1
float(1382714296.001) processed in 486.63592338562 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16 Fatal error: Unknown: The inner constructor wasn't initialized with an iterator instance in Unknown on line 0
Process exited with code 255.
Output for 5.0.0
float(1382714296.0007) processed in 470.69191932678 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/dMquQ on line 16
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/dMquQ on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/dMquQ on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/dMquQ on line 16
Process exited with code 255.