3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code ='<!-- DEFINE $SEARCH_BOX --> <!-- ENDDEFINE -->'; $phpbb_tags = array( /*'BEGIN', 'BEGINELSE', 'END', 'IF', 'ELSE', 'ELSEIF', 'ENDIF', 'DEFINE', 'UNDEFINE',*/ 'ENDDEFINE', 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', 'PHP', 'ENDPHP', 'EVENT', ); // Twig tag masks $twig_tags = array( 'autoescape', 'endautoescape', 'if', 'elseif', 'else', 'endif', 'block', 'endblock', 'use', 'extends', 'embed', 'filter', 'endfilter', 'flush', 'for', 'endfor', 'macro', 'endmacro', 'import', 'from', 'sandbox', 'endsandbox', 'set', 'endset', 'spaceless', 'endspaceless', 'verbatim', 'endverbatim', ); // Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}') $code = strip_surrounding_quotes(array( 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', ), $code); $code = fix_inline_variable_tokens(array( 'DEFINE \$[a-zA-Z0-9_]+ =', 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', ), $code); $code = add_surrounding_quotes(array( 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', ), $code); // Fix our BEGIN statements $code = fix_begin_tokens($code); // Fix our IF tokens $code = fix_if_tokens($code); // Fix our DEFINE tokens $code = fix_define_tokens($code); // Replace all of our starting tokens, <!-- TOKEN --> with Twig style, {% TOKEN %} // This also strips outer parenthesis, <!-- IF (blah) --> becomes <!-- IF blah --> $code = preg_replace('#<!-- (' . implode('|', $phpbb_tags) . ')(?: (.*?) ?)?-->#', '{% $1 $2 %}', $code); // Replace all of our twig masks with Twig code (e.g. <!-- BLOCK .+ --> with {% block $1 %}) $code = replace_twig_tag_masks($code, $twig_tags); // Replace all of our language variables, {L_VARNAME}, with Twig style, {{ lang('NAME') }} // Appends any filters after lang() $code = preg_replace('#{L_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2 }}', $code); // Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|escape('js') }} // Appends any filters after lang(), but before escape('js') $code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2|escape(\'js\') }}', $code); // Replace all of our variables, {VARNAME}, with Twig style, {{ VARNAME }} // Appends any filters $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code); echo $code;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0030.01216.63
8.3.50.0150.00621.25
8.3.40.0090.00618.83
8.3.30.0040.01118.81
8.3.20.0070.00020.16
8.3.10.0080.00023.36
8.3.00.0040.00419.69
8.2.180.0000.01816.88
8.2.170.0070.00722.96
8.2.160.0190.00620.38
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0030.00517.50
8.2.110.0170.00322.07
8.2.100.0080.00417.72
8.2.90.0050.00319.13
8.2.80.0060.00317.97
8.2.70.0060.00317.38
8.2.60.0040.00418.04
8.2.50.0050.00318.10
8.2.40.0000.00822.33
8.2.30.0000.00819.78
8.2.20.0080.00017.77
8.2.10.0040.00418.08
8.2.00.0060.00318.09
8.1.280.0070.00725.92
8.1.270.0200.00020.33
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0130.01023.63
8.1.230.0080.00421.03
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.35
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0040.00418.44
8.1.160.0000.00722.23
8.1.150.0000.00718.94
8.1.140.0080.00017.38
8.1.130.0080.00017.77
8.1.120.0000.00717.41
8.1.110.0040.00417.43
8.1.100.0030.00517.42
8.1.90.0050.00217.38
8.1.80.0040.00417.39
8.1.70.0020.00517.30
8.1.60.0000.00817.55
8.1.50.0030.00517.44
8.1.40.0040.00417.42
8.1.30.0030.00617.58
8.1.20.0000.00717.63
8.1.10.0050.00217.62
8.1.00.0060.00317.60
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0040.00418.32
8.0.270.0030.00317.25
8.0.260.0000.00617.12
8.0.250.0060.00317.03
8.0.240.0070.00316.87
8.0.230.0000.00716.89
8.0.220.0080.00016.81
8.0.210.0000.00716.91
8.0.200.0030.00616.97
8.0.190.0000.00817.04
8.0.180.0040.00416.82
8.0.170.0040.00416.82
8.0.160.0050.00316.97
8.0.150.0030.00316.87
8.0.140.0040.00416.85
8.0.130.0000.00713.30
8.0.120.0050.00316.78
8.0.110.0050.00316.95
8.0.100.0000.00716.71
8.0.90.0040.00416.74
8.0.80.0090.00616.87
8.0.70.0000.00916.77
8.0.60.0030.00616.98
8.0.50.0060.00316.88
8.0.30.0090.00917.18
8.0.20.0100.00917.40
8.0.10.0030.00316.82
8.0.00.0060.01116.71
7.4.330.0020.00215.08
7.4.320.0070.00016.57
7.4.300.0060.00316.46
7.4.290.0080.00016.48
7.4.280.0040.00416.44
7.4.270.0000.00716.60
7.4.260.0040.00416.63
7.4.250.0040.00416.59
7.4.240.0030.00316.63
7.4.230.0030.00316.74
7.4.220.0100.01416.55
7.4.210.0040.01516.49
7.4.200.0030.00316.72
7.4.160.0150.00916.57
7.4.150.0120.00617.40
7.4.140.0160.00517.86
7.4.130.0140.00616.52
7.4.120.0160.00516.54
7.4.110.0100.01316.32
7.4.100.0180.00616.45
7.4.90.0090.00916.45
7.4.80.0000.02019.39
7.4.70.0060.01216.61
7.4.60.0120.00416.41
7.4.50.0000.00916.49
7.4.40.0030.01316.44
7.4.30.0100.00716.70
7.4.00.0030.01215.07
7.3.330.0020.00213.18
7.3.320.0030.00313.28
7.3.310.0000.00716.37
7.3.300.0050.00216.20
7.3.290.0040.01116.26
7.3.280.0080.00916.28
7.3.270.0000.01817.40
7.3.260.0030.01316.39
7.3.250.0120.00816.40
7.3.240.0100.01316.59
7.3.230.0030.01316.50
7.3.210.0070.01016.56
7.3.200.0030.01816.59
7.3.190.0130.00716.37
7.3.180.0060.01016.53
7.3.170.0120.00416.53
7.3.160.0080.00916.61
7.3.120.0130.00614.75
7.3.110.0110.00714.81
7.3.100.0100.01014.77
7.3.90.0040.01114.86
7.3.80.0070.00714.97
7.3.70.0030.01614.46
7.3.60.0030.00914.93
7.3.50.0040.01114.70
7.3.40.0030.00614.75
7.3.30.0080.00814.86
7.3.20.0070.01016.46
7.3.10.0060.00616.65
7.3.00.0000.01316.54
7.2.330.0060.01516.29
7.2.320.0160.00616.56
7.2.310.0030.01916.51
7.2.300.0120.00816.63
7.2.290.0080.01116.53
7.2.250.0070.01015.02
7.2.240.0030.01614.63
7.2.230.0030.01014.98
7.2.220.0040.01114.86
7.2.210.0100.01014.82
7.2.200.0150.00014.57
7.2.190.0060.00914.85
7.2.180.0070.00714.88
7.2.170.0030.00714.93
7.2.160.0100.00714.58
7.2.150.0030.00616.64
7.2.140.0090.00616.81
7.2.130.0060.00916.81
7.2.120.0110.00716.79
7.2.110.0030.01016.80
7.2.100.0000.01216.83
7.2.90.0000.01216.89
7.2.80.0090.00916.55
7.2.70.0040.00816.92
7.2.60.0090.00416.42
7.2.50.0070.00316.70
7.2.40.0070.00716.82
7.2.30.0060.00316.71
7.2.20.0090.00616.61
7.2.10.0090.00316.59
7.2.00.0080.01018.16
7.1.330.0070.01015.32
7.1.320.0000.01415.64
7.1.310.0030.01515.70
7.1.300.0070.01015.61
7.1.290.0080.00815.49
7.1.280.0000.01415.64
7.1.270.0080.00815.64
7.1.260.0030.00615.77
7.1.250.0100.00715.46
7.1.240.0040.00815.59
7.1.230.0030.00915.33
7.1.220.0110.00415.34
7.1.210.0070.00715.57
7.1.200.0090.00415.48
7.1.190.0030.00615.72
7.1.180.0080.00815.59
7.1.170.0060.00615.65
7.1.160.0030.01015.66
7.1.150.0000.01515.60
7.1.140.0060.00915.47
7.1.130.0100.00615.36
7.1.120.0030.01215.56
7.1.110.0090.00315.71
7.1.100.0030.00716.86
7.1.90.0000.01415.30
7.1.80.0120.00315.56
7.1.70.0080.00316.12
7.1.60.0070.01017.28
7.1.50.0080.01115.90
7.1.40.0040.01115.51
7.1.30.0030.00915.66
7.1.20.0000.01115.60
7.1.10.0040.01115.50
7.1.00.0040.04118.95
7.0.330.0080.00615.09
7.0.320.0050.00315.20
7.0.310.0070.01015.37
7.0.300.0060.01015.20
7.0.290.0000.01315.34
7.0.280.0040.01115.13
7.0.270.0070.00715.28
7.0.260.0040.01115.32
7.0.250.0030.01015.26
7.0.240.0060.00615.28
7.0.230.0040.01115.35
7.0.220.0030.00615.38
7.0.210.0060.00615.25
7.0.200.0090.00315.97
7.0.190.0030.01415.19
7.0.180.0030.01015.15
7.0.170.0030.00915.41
7.0.160.0050.00515.40
7.0.150.0130.00315.32
7.0.140.0070.00715.45
7.0.130.0030.00715.14
7.0.120.0100.00715.21
7.0.110.0030.01015.13
7.0.100.0140.00015.29
7.0.90.0060.00915.16
7.0.80.0000.01515.45
7.0.70.0060.00915.54
7.0.60.0130.04217.70
7.0.50.0070.02216.54
7.0.40.0070.02516.75
7.0.30.0260.03516.70
7.0.20.0180.02516.68
7.0.10.0050.04916.73
7.0.00.0070.04216.74
5.6.400.0070.00714.46
5.6.390.0070.00714.29
5.6.380.0090.00014.25
5.6.370.0040.00814.40
5.6.360.0040.01214.45
5.6.350.0070.00714.05
5.6.340.0120.00314.21
5.6.330.0060.00614.04
5.6.320.0060.00614.12
5.6.310.0000.01014.37
5.6.300.0000.01414.02
5.6.290.0040.00814.27
5.6.280.0020.02317.72
5.6.270.0060.01013.85
5.6.260.0060.00614.30
5.6.250.0090.00314.25
5.6.240.0070.00713.86
5.6.230.0070.00714.35
5.6.220.0070.00713.99
5.6.210.0080.03517.29
5.6.200.0080.04516.26
5.6.190.0090.02417.18
5.6.180.1590.02517.28
5.6.170.0150.02517.48
5.6.160.0080.04717.47
5.6.150.0080.02616.37
5.6.140.0050.03016.16
5.6.130.0080.02316.26
5.6.120.0030.03517.72
5.6.110.0030.03317.64
5.6.100.0060.03817.60
5.6.90.0120.04017.64
5.6.80.0030.05017.36
5.6.70.2310.02117.16
5.6.60.0000.01514.30
5.6.50.0030.00914.13
5.6.40.0040.01414.41
5.6.30.0130.00313.98
5.6.20.0060.00614.21
5.6.10.0040.01113.95
5.6.00.0040.01114.11
5.5.380.0120.00214.07
5.5.370.0060.00614.20
5.5.360.0030.01314.06
5.5.350.0060.04217.30
5.5.340.0050.03516.01
5.5.330.0050.03817.07
5.5.320.0190.03217.07
5.5.310.0170.05316.97
5.5.300.0060.04416.08
5.5.290.0020.02815.90
5.5.280.0100.02017.53
5.5.270.0030.04517.54
5.5.260.0080.03817.58
5.5.250.0100.02117.47
5.5.240.0120.04117.19
5.5.230.0070.00713.97
5.5.220.0000.01814.01
5.5.210.0030.01413.86
5.5.200.0120.00214.18
5.5.190.0110.00613.77
5.5.180.0160.00314.09
5.5.170.0130.00314.04
5.5.160.0130.00314.20
5.5.150.0060.00914.17
5.5.140.0070.00714.16
5.5.130.0000.01313.97
5.5.120.0080.00813.94
5.5.110.0070.00313.64
5.5.100.0030.01313.90
5.5.90.0060.01013.86
5.5.80.0030.01013.74
5.5.70.0060.00613.60
5.5.60.0060.00613.90
5.5.50.0030.01314.12
5.5.40.0000.01213.89
5.5.30.0030.01013.50
5.5.20.0060.00913.68
5.5.10.0060.00914.09
5.5.00.0120.00614.05
5.4.450.0310.03515.80
5.4.440.0390.02715.63
5.4.430.0230.03215.78
5.4.420.0020.03815.73
5.4.410.0170.03215.66
5.4.400.0320.03415.57
5.4.390.0230.03815.38
5.4.380.0300.03115.49
5.4.370.0470.02715.56
5.4.360.0300.03315.60
5.4.350.0410.02815.38
5.4.340.0380.02815.54
5.4.330.0000.00912.00
5.4.320.0350.03415.55
5.4.310.0330.03515.54
5.4.300.0350.03315.53
5.4.290.0410.03515.63
5.4.280.0450.03315.58
5.4.270.0360.02615.59
5.4.260.0380.04115.51
5.4.250.0320.03615.43
5.4.240.0320.02715.61
5.4.230.0310.03215.44
5.4.220.0320.03515.53
5.4.210.0290.03415.52
5.4.200.0380.02815.43
5.4.190.0350.02915.63
5.4.180.0320.04015.52
5.4.170.0430.03815.61
5.4.160.0440.03515.43
5.4.150.0440.02715.60
5.4.140.0320.03314.12
5.4.130.0300.03214.15
5.4.120.0410.02314.21
5.4.110.0270.03514.23
5.4.100.0450.02914.23
5.4.90.0440.02314.27
5.4.80.0400.02814.20
5.4.70.0030.03714.21
5.4.60.0180.02814.24
5.4.50.0020.03314.23
5.4.40.0080.03414.03
5.4.30.0030.02114.20
5.4.20.0150.04014.02
5.4.10.0060.00612.00
5.4.00.0030.01012.00

preferences:
61.67 ms | 401 KiB | 5 Q