3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = '1|27|31|33'; $separator = '##|##'; $iterations = 100000; $time = microtime(true); for ($i = 0; $i < $iterations; $i++) { $result = str_replace('|', $separator, $input); } $time1 = microtime(true); echo 'processed with str_replace in ' . round(($time1 - $time) * 1000) . ' millisecs' . PHP_EOL; 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 with CachingIterator in ' . round(($time2 - $time1) * 1000) . ' millisecs' . PHP_EOL;

Abusive script

This script was stopped while abusing our resources

Output for 7.1.6
processed with str_replace in 16 millisecs processed with CachingIterator in 370 millisecs
Output for 7.1.5
processed with str_replace in 16 millisecs processed with CachingIterator in 365 millisecs
Output for 7.1.4
processed with str_replace in 18 millisecs processed with CachingIterator in 445 millisecs
Output for 7.1.3
processed with str_replace in 20 millisecs processed with CachingIterator in 496 millisecs
Output for 7.1.2
processed with str_replace in 18 millisecs processed with CachingIterator in 417 millisecs
Output for 7.1.1
processed with str_replace in 17 millisecs processed with CachingIterator in 423 millisecs
Output for 7.1.0
processed with str_replace in 24 millisecs processed with CachingIterator in 420 millisecs
Output for 7.0.20
processed with str_replace in 20 millisecs processed with CachingIterator in 514 millisecs
Output for 7.0.19
processed with str_replace in 15 millisecs processed with CachingIterator in 377 millisecs
Output for 7.0.18
processed with str_replace in 16 millisecs processed with CachingIterator in 406 millisecs
Output for 7.0.17
processed with str_replace in 16 millisecs processed with CachingIterator in 471 millisecs
Output for 7.0.16
processed with str_replace in 17 millisecs processed with CachingIterator in 416 millisecs
Output for 7.0.15
processed with str_replace in 20 millisecs processed with CachingIterator in 608 millisecs
Output for 7.0.14
processed with str_replace in 18 millisecs processed with CachingIterator in 526 millisecs
Output for 7.0.13
processed with str_replace in 16 millisecs processed with CachingIterator in 631 millisecs
Output for 7.0.12
processed with str_replace in 17 millisecs processed with CachingIterator in 712 millisecs
Output for 7.0.11
processed with str_replace in 17 millisecs processed with CachingIterator in 464 millisecs
Output for 7.0.10
processed with str_replace in 18 millisecs processed with CachingIterator in 474 millisecs
Output for 7.0.9
processed with str_replace in 18 millisecs processed with CachingIterator in 612 millisecs
Output for 7.0.8
processed with str_replace in 36 millisecs processed with CachingIterator in 528 millisecs
Output for 7.0.7
processed with str_replace in 34 millisecs processed with CachingIterator in 427 millisecs
Output for 7.0.6
processed with str_replace in 25 millisecs processed with CachingIterator in 529 millisecs
Output for 7.0.5
processed with str_replace in 26 millisecs processed with CachingIterator in 494 millisecs
Output for 7.0.4
processed with str_replace in 19 millisecs processed with CachingIterator in 467 millisecs
Output for 7.0.3
processed with str_replace in 20 millisecs processed with CachingIterator in 477 millisecs
Output for 7.0.2
processed with str_replace in 16 millisecs processed with CachingIterator in 446 millisecs
Output for 7.0.1
processed with str_replace in 16 millisecs processed with CachingIterator in 399 millisecs
Output for 7.0.0
processed with str_replace in 35 millisecs processed with CachingIterator in 533 millisecs
Output for hhvm-3.17.3
processed with str_replace in 29 millisecs
Process exited with code 137.
Output for hhvm-3.15.4
processed with str_replace in 33 millisecs
Process exited with code 137.
Output for hhvm-3.13.2
processed with str_replace in 31 millisecs
Process exited with code 137.
Output for hhvm-3.12.14
processed with str_replace in 56 millisecs
Process exited with code 137.
Output for hhvm-3.11.1
processed with str_replace in 36 millisecs
Process exited with code 137.
Output for hhvm-3.10.1
processed with str_replace in 68 millisecs
Process exited with code 137.
Output for 5.6.30
processed with str_replace in 75 millisecs processed with CachingIterator in 1180 millisecs
Output for 5.6.29
processed with str_replace in 63 millisecs processed with CachingIterator in 839 millisecs
Output for 5.6.28
processed with str_replace in 80 millisecs processed with CachingIterator in 900 millisecs
Output for 5.6.27
processed with str_replace in 56 millisecs processed with CachingIterator in 784 millisecs
Output for 5.6.26
processed with str_replace in 38 millisecs processed with CachingIterator in 891 millisecs
Output for 5.6.25
processed with str_replace in 47 millisecs processed with CachingIterator in 859 millisecs
Output for 5.6.24
processed with str_replace in 61 millisecs processed with CachingIterator in 959 millisecs
Output for 5.6.23
processed with str_replace in 43 millisecs processed with CachingIterator in 757 millisecs
Output for 5.6.22
processed with str_replace in 42 millisecs processed with CachingIterator in 648 millisecs
Output for 5.6.21
processed with str_replace in 41 millisecs processed with CachingIterator in 778 millisecs
Output for 5.6.20
processed with str_replace in 56 millisecs processed with CachingIterator in 811 millisecs
Output for 5.6.19
processed with str_replace in 68 millisecs processed with CachingIterator in 1059 millisecs
Output for 5.6.18
processed with str_replace in 45 millisecs processed with CachingIterator in 821 millisecs
Output for 5.6.17
processed with str_replace in 34 millisecs processed with CachingIterator in 662 millisecs
Output for 5.6.16
processed with str_replace in 50 millisecs processed with CachingIterator in 818 millisecs
Output for 5.6.15
processed with str_replace in 36 millisecs processed with CachingIterator in 633 millisecs
Output for 5.6.14
processed with str_replace in 63 millisecs processed with CachingIterator in 772 millisecs
Output for 5.6.13
processed with str_replace in 42 millisecs processed with CachingIterator in 639 millisecs
Output for 5.6.12
processed with str_replace in 35 millisecs processed with CachingIterator in 673 millisecs
Output for 5.6.11
processed with str_replace in 36 millisecs processed with CachingIterator in 667 millisecs
Output for 5.5.10, 5.6.10
processed with str_replace in 39 millisecs processed with CachingIterator in 634 millisecs
Output for 5.6.9
processed with str_replace in 63 millisecs processed with CachingIterator in 864 millisecs
Output for 5.6.8
processed with str_replace in 70 millisecs processed with CachingIterator in 716 millisecs
Output for 5.6.7
processed with str_replace in 37 millisecs processed with CachingIterator in 814 millisecs
Output for 5.6.6
processed with str_replace in 48 millisecs processed with CachingIterator in 1121 millisecs
Output for 5.6.5
processed with str_replace in 36 millisecs processed with CachingIterator in 617 millisecs
Output for 5.6.4
processed with str_replace in 36 millisecs processed with CachingIterator in 649 millisecs
Output for 5.6.3
processed with str_replace in 42 millisecs processed with CachingIterator in 674 millisecs
Output for 5.6.2
processed with str_replace in 48 millisecs processed with CachingIterator in 632 millisecs
Output for 5.6.1
processed with str_replace in 70 millisecs processed with CachingIterator in 636 millisecs
Output for 5.6.0
processed with str_replace in 38 millisecs processed with CachingIterator in 910 millisecs
Output for 5.5.38
processed with str_replace in 76 millisecs processed with CachingIterator in 790 millisecs
Output for 5.5.37
processed with str_replace in 66 millisecs processed with CachingIterator in 949 millisecs
Output for 5.5.36
processed with str_replace in 78 millisecs processed with CachingIterator in 618 millisecs
Output for 5.5.35
processed with str_replace in 46 millisecs processed with CachingIterator in 858 millisecs
Output for 5.5.34
processed with str_replace in 48 millisecs processed with CachingIterator in 612 millisecs
Output for 5.5.33
processed with str_replace in 57 millisecs processed with CachingIterator in 706 millisecs
Output for 5.5.32
processed with str_replace in 57 millisecs processed with CachingIterator in 800 millisecs
Output for 5.5.31
processed with str_replace in 48 millisecs processed with CachingIterator in 796 millisecs
Output for 5.5.30
processed with str_replace in 42 millisecs processed with CachingIterator in 837 millisecs
Output for 5.5.29
processed with str_replace in 43 millisecs processed with CachingIterator in 774 millisecs
Output for 5.5.28
processed with str_replace in 39 millisecs processed with CachingIterator in 781 millisecs
Output for 5.5.27
processed with str_replace in 79 millisecs processed with CachingIterator in 963 millisecs
Output for 5.5.26
processed with str_replace in 38 millisecs processed with CachingIterator in 623 millisecs
Output for 5.5.25
processed with str_replace in 41 millisecs processed with CachingIterator in 727 millisecs
Output for 5.5.24
processed with str_replace in 64 millisecs processed with CachingIterator in 753 millisecs
Output for 5.5.23
processed with str_replace in 51 millisecs processed with CachingIterator in 730 millisecs
Output for 5.5.22
processed with str_replace in 76 millisecs processed with CachingIterator in 861 millisecs
Output for 5.5.21
processed with str_replace in 36 millisecs processed with CachingIterator in 621 millisecs
Output for 5.5.20
processed with str_replace in 55 millisecs processed with CachingIterator in 936 millisecs
Output for 5.5.19
processed with str_replace in 43 millisecs processed with CachingIterator in 710 millisecs
Output for 5.5.18
processed with str_replace in 84 millisecs processed with CachingIterator in 733 millisecs
Output for 5.5.16
processed with str_replace in 42 millisecs processed with CachingIterator in 652 millisecs
Output for 5.5.15
processed with str_replace in 37 millisecs processed with CachingIterator in 635 millisecs
Output for 5.5.14
processed with str_replace in 44 millisecs processed with CachingIterator in 657 millisecs
Output for 5.4.27, 5.5.13
processed with str_replace in 37 millisecs processed with CachingIterator in 605 millisecs
Output for 5.5.12
processed with str_replace in 42 millisecs processed with CachingIterator in 676 millisecs
Output for 5.5.11
processed with str_replace in 38 millisecs processed with CachingIterator in 667 millisecs
Output for 5.5.9
processed with str_replace in 57 millisecs processed with CachingIterator in 681 millisecs
Output for 5.5.8
processed with str_replace in 43 millisecs processed with CachingIterator in 681 millisecs
Output for 5.5.7
processed with str_replace in 41 millisecs processed with CachingIterator in 593 millisecs
Output for 5.5.6
processed with str_replace in 46 millisecs processed with CachingIterator in 622 millisecs
Output for 5.5.5
processed with str_replace in 35 millisecs processed with CachingIterator in 586 millisecs
Output for 5.5.4
processed with str_replace in 55 millisecs processed with CachingIterator in 681 millisecs
Output for 5.5.3
processed with str_replace in 37 millisecs processed with CachingIterator in 626 millisecs
Output for 5.5.2
processed with str_replace in 76 millisecs processed with CachingIterator in 740 millisecs
Output for 5.5.1
processed with str_replace in 43 millisecs processed with CachingIterator in 632 millisecs
Output for 5.5.0
processed with str_replace in 40 millisecs processed with CachingIterator in 890 millisecs
Output for 5.4.45
processed with str_replace in 36 millisecs processed with CachingIterator in 555 millisecs
Output for 5.4.44
processed with str_replace in 42 millisecs processed with CachingIterator in 727 millisecs
Output for 5.4.43
processed with str_replace in 47 millisecs processed with CachingIterator in 837 millisecs
Output for 5.4.42
processed with str_replace in 35 millisecs processed with CachingIterator in 620 millisecs
Output for 5.4.41
processed with str_replace in 39 millisecs processed with CachingIterator in 582 millisecs
Output for 5.4.40
processed with str_replace in 56 millisecs processed with CachingIterator in 825 millisecs
Output for 5.4.39
processed with str_replace in 47 millisecs processed with CachingIterator in 761 millisecs
Output for 5.4.38
processed with str_replace in 72 millisecs processed with CachingIterator in 658 millisecs
Output for 5.4.37
processed with str_replace in 38 millisecs processed with CachingIterator in 972 millisecs
Output for 5.4.36
processed with str_replace in 44 millisecs processed with CachingIterator in 646 millisecs
Output for 5.4.35
processed with str_replace in 40 millisecs processed with CachingIterator in 640 millisecs
Output for 5.4.34
processed with str_replace in 88 millisecs processed with CachingIterator in 915 millisecs
Output for 5.4.32
processed with str_replace in 40 millisecs processed with CachingIterator in 602 millisecs
Output for 5.4.31
processed with str_replace in 42 millisecs processed with CachingIterator in 662 millisecs
Output for 5.4.30
processed with str_replace in 35 millisecs processed with CachingIterator in 542 millisecs
Output for 5.4.29
processed with str_replace in 41 millisecs processed with CachingIterator in 613 millisecs
Output for 5.4.28
processed with str_replace in 36 millisecs processed with CachingIterator in 581 millisecs
Output for 5.4.26
processed with str_replace in 36 millisecs processed with CachingIterator in 655 millisecs
Output for 5.4.25
processed with str_replace in 42 millisecs processed with CachingIterator in 653 millisecs
Output for 5.4.24
processed with str_replace in 56 millisecs processed with CachingIterator in 659 millisecs
Output for 5.4.23
processed with str_replace in 42 millisecs processed with CachingIterator in 619 millisecs
Output for 5.4.22
processed with str_replace in 41 millisecs processed with CachingIterator in 608 millisecs
Output for 5.4.21
processed with str_replace in 37 millisecs processed with CachingIterator in 647 millisecs
Output for 5.4.20
processed with str_replace in 47 millisecs processed with CachingIterator in 590 millisecs
Output for 5.4.19
processed with str_replace in 36 millisecs processed with CachingIterator in 574 millisecs
Output for 5.4.18
processed with str_replace in 40 millisecs processed with CachingIterator in 652 millisecs
Output for 5.4.17
processed with str_replace in 45 millisecs processed with CachingIterator in 746 millisecs
Output for 5.4.16
processed with str_replace in 55 millisecs processed with CachingIterator in 657 millisecs
Output for 5.4.15
processed with str_replace in 38 millisecs processed with CachingIterator in 728 millisecs
Output for 5.4.14
processed with str_replace in 37 millisecs processed with CachingIterator in 847 millisecs
Output for 5.4.13
processed with str_replace in 42 millisecs processed with CachingIterator in 696 millisecs
Output for 5.4.12
processed with str_replace in 53 millisecs processed with CachingIterator in 919 millisecs
Output for 5.4.11
processed with str_replace in 68 millisecs processed with CachingIterator in 806 millisecs
Output for 5.4.10
processed with str_replace in 76 millisecs processed with CachingIterator in 733 millisecs
Output for 5.4.9
processed with str_replace in 56 millisecs processed with CachingIterator in 621 millisecs
Output for 5.4.8
processed with str_replace in 70 millisecs processed with CachingIterator in 627 millisecs
Output for 5.4.7
processed with str_replace in 39 millisecs processed with CachingIterator in 1592 millisecs
Output for 5.4.6
processed with str_replace in 42 millisecs processed with CachingIterator in 693 millisecs
Output for 5.4.5
processed with str_replace in 67 millisecs processed with CachingIterator in 703 millisecs
Output for 5.4.4
processed with str_replace in 40 millisecs processed with CachingIterator in 674 millisecs
Output for 5.4.3
processed with str_replace in 71 millisecs processed with CachingIterator in 952 millisecs
Output for 5.4.2
processed with str_replace in 41 millisecs processed with CachingIterator in 1143 millisecs
Output for 5.4.1
processed with str_replace in 45 millisecs processed with CachingIterator in 702 millisecs
Output for 5.4.0
processed with str_replace in 41 millisecs processed with CachingIterator in 681 millisecs
Output for 5.3.29
processed with str_replace in 80 millisecs processed with CachingIterator in 860 millisecs
Output for 5.3.28
processed with str_replace in 55 millisecs processed with CachingIterator in 739 millisecs
Output for 5.3.27
processed with str_replace in 88 millisecs processed with CachingIterator in 851 millisecs
Output for 5.3.26
processed with str_replace in 55 millisecs processed with CachingIterator in 872 millisecs
Output for 5.3.25
processed with str_replace in 84 millisecs processed with CachingIterator in 1158 millisecs
Output for 5.3.24
processed with str_replace in 89 millisecs processed with CachingIterator in 1180 millisecs
Output for 5.3.23
processed with str_replace in 58 millisecs processed with CachingIterator in 871 millisecs
Output for 5.3.22
processed with str_replace in 77 millisecs processed with CachingIterator in 1008 millisecs
Output for 5.3.21
processed with str_replace in 63 millisecs processed with CachingIterator in 1617 millisecs
Output for 5.3.20
processed with str_replace in 50 millisecs processed with CachingIterator in 1134 millisecs
Output for 5.3.19
processed with str_replace in 61 millisecs processed with CachingIterator in 916 millisecs
Output for 5.3.18
processed with str_replace in 53 millisecs processed with CachingIterator in 1073 millisecs
Output for 5.3.17
processed with str_replace in 157 millisecs processed with CachingIterator in 1156 millisecs
Output for 5.3.16
processed with str_replace in 65 millisecs processed with CachingIterator in 744 millisecs
Output for 5.3.15
processed with str_replace in 74 millisecs processed with CachingIterator in 911 millisecs
Output for 5.3.14
processed with str_replace in 60 millisecs processed with CachingIterator in 806 millisecs
Output for 5.3.13
processed with str_replace in 63 millisecs processed with CachingIterator in 1185 millisecs
Output for 5.3.12
processed with str_replace in 83 millisecs processed with CachingIterator in 891 millisecs
Output for 5.3.11
processed with str_replace in 91 millisecs processed with CachingIterator in 992 millisecs
Output for 5.3.10
processed with str_replace in 51 millisecs processed with CachingIterator in 690 millisecs
Output for 5.3.9
processed with str_replace in 69 millisecs processed with CachingIterator in 868 millisecs
Output for 5.3.8
processed with str_replace in 60 millisecs processed with CachingIterator in 1109 millisecs
Output for 5.3.7
processed with str_replace in 54 millisecs processed with CachingIterator in 1019 millisecs
Output for 5.3.6
processed with str_replace in 70 millisecs processed with CachingIterator in 937 millisecs
Output for 5.3.5
processed with str_replace in 61 millisecs processed with CachingIterator in 798 millisecs
Output for 5.3.4
processed with str_replace in 101 millisecs processed with CachingIterator in 1020 millisecs
Output for 5.3.3
processed with str_replace in 93 millisecs processed with CachingIterator in 891 millisecs
Output for 5.3.2
processed with str_replace in 90 millisecs processed with CachingIterator in 842 millisecs
Output for 5.3.1
processed with str_replace in 64 millisecs processed with CachingIterator in 717 millisecs
Output for 5.3.0
processed with str_replace in 87 millisecs processed with CachingIterator in 819 millisecs
Output for 5.2.17
processed with str_replace in 81 millisecs processed with CachingIterator in 869 millisecs
Output for 5.2.16
processed with str_replace in 70 millisecs processed with CachingIterator in 832 millisecs
Output for 5.2.15
processed with str_replace in 56 millisecs processed with CachingIterator in 775 millisecs
Output for 5.2.14
processed with str_replace in 90 millisecs processed with CachingIterator in 939 millisecs
Output for 5.2.13
processed with str_replace in 51 millisecs processed with CachingIterator in 869 millisecs
Output for 5.2.12
processed with str_replace in 56 millisecs processed with CachingIterator in 790 millisecs
Output for 5.2.11
processed with str_replace in 67 millisecs processed with CachingIterator in 1023 millisecs
Output for 5.2.10
processed with str_replace in 58 millisecs processed with CachingIterator in 947 millisecs
Output for 5.2.9
processed with str_replace in 97 millisecs processed with CachingIterator in 894 millisecs
Output for 5.2.8
processed with str_replace in 66 millisecs processed with CachingIterator in 734 millisecs
Output for 5.2.7
processed with str_replace in 67 millisecs processed with CachingIterator in 902 millisecs
Output for 5.2.6
processed with str_replace in 61 millisecs processed with CachingIterator in 763 millisecs
Output for 5.2.5
processed with str_replace in 58 millisecs processed with CachingIterator in 807 millisecs
Output for 5.2.4
processed with str_replace in 89 millisecs processed with CachingIterator in 790 millisecs
Output for 5.2.3
processed with str_replace in 94 millisecs processed with CachingIterator in 773 millisecs
Output for 5.2.2
processed with str_replace in 118 millisecs processed with CachingIterator in 723 millisecs
Output for 5.2.1
processed with str_replace in 93 millisecs processed with CachingIterator in 787 millisecs
Output for 5.2.0
processed with str_replace in 73 millisecs processed with CachingIterator in 730 millisecs
Output for 5.1.3, 5.1.6
processed with str_replace in 51 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18
Process exited with code 255.
Output for 5.1.2, 5.1.5
processed with str_replace in 49 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18
Process exited with code 255.
Output for 5.1.4
processed with str_replace in 73 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18
Process exited with code 255.
Output for 5.1.1
processed with str_replace in 52 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18
Process exited with code 255.
Output for 5.1.0
processed with str_replace in 55 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18
Process exited with code 255.
Output for 5.0.5
processed with str_replace in 98 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18 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
processed with str_replace in 143 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18 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
processed with str_replace in 87 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18 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
processed with str_replace in 97 millisecs Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18 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
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vvnit on line 13 processed with str_replace in 92 millisecsPHP_EOL Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18 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
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vvnit on line 13 processed with str_replace in 103 millisecsPHP_EOL Fatal error: Undefined class constant 'FULL_CACHE' in /in/vvnit on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/vvnit on line 18
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/vvnit on line 18
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/vvnit on line 18
Process exited with code 255.