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 = $this->strip_surrounding_quotes(array( 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', ), $code); $code = $this->fix_inline_variable_tokens(array( 'DEFINE \$[a-zA-Z0-9_]+ =', 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', ), $code); $code = $this->add_surrounding_quotes(array( 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', 'INCLUDECSS', ), $code); // Fix our BEGIN statements $code = $this->fix_begin_tokens($code); // Fix our IF tokens $code = $this->fix_if_tokens($code); // Fix our DEFINE tokens $code = $this->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 = $this->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.0100.00716.63
8.3.50.0140.00821.02
8.3.40.0040.01118.79
8.3.30.0110.00418.84
8.3.20.0000.00820.34
8.3.10.0050.00323.65
8.3.00.0030.00619.45
8.2.180.0190.00616.75
8.2.170.0060.00822.96
8.2.160.0170.00720.38
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00721.05
8.2.110.0090.00021.97
8.2.100.0090.00317.50
8.2.90.0040.00418.97
8.2.80.0080.00017.97
8.2.70.0070.00317.63
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0090.00019.26
8.2.30.0040.00419.84
8.2.20.0040.00417.71
8.2.10.0050.00218.14
8.2.00.0040.00418.00
8.1.280.0140.00025.92
8.1.270.0070.01020.29
8.1.260.0030.00526.35
8.1.250.0020.00528.09
8.1.240.0060.00322.58
8.1.230.0060.00617.42
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.22
8.1.190.0030.00617.35
8.1.180.0050.00318.10
8.1.170.0000.00818.52
8.1.160.0070.00021.86
8.1.150.0000.00718.85
8.1.140.0030.00517.40
8.1.130.0040.00417.56
8.1.120.0000.00717.38
8.1.110.0040.00417.34
8.1.100.0000.00817.40
8.1.90.0040.00417.46
8.1.80.0040.00417.32
8.1.70.0000.00717.30
8.1.60.0060.00317.57
8.1.50.0000.00717.60
8.1.40.0030.00517.42
8.1.30.0040.00417.62
8.1.20.0000.00717.56
8.1.10.0000.00717.63
8.1.00.0030.00517.51
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0070.00018.44
8.0.270.0030.00317.12
8.0.260.0060.00017.21
8.0.250.0030.00616.97
8.0.240.0060.00316.89
8.0.230.0070.00016.98
8.0.220.0080.00016.82
8.0.210.0000.00716.79
8.0.200.0040.00416.89
8.0.190.0080.00016.89
8.0.180.0030.00516.79
8.0.170.0030.00616.80
8.0.160.0070.00016.79
8.0.150.0000.00816.94
8.0.140.0030.00516.89
8.0.130.0040.00413.33
8.0.120.0050.00316.93
8.0.110.0030.00616.91
8.0.100.0040.00416.98
8.0.90.0020.00516.74
8.0.80.0130.00316.84
8.0.70.0000.00816.88
8.0.60.0080.00016.83
8.0.50.0050.00316.82
8.0.30.0090.00516.90
8.0.20.0130.00617.40
8.0.10.0080.00017.06
8.0.00.0060.01116.90
7.4.330.0030.00315.08
7.4.320.0060.00016.57
7.4.300.0060.00316.64
7.4.290.0040.00416.41
7.4.280.0080.00016.61
7.4.270.0000.00716.68
7.4.260.0030.00516.56
7.4.250.0080.00016.51
7.4.240.0000.00816.58
7.4.230.0000.00716.70
7.4.220.0130.00716.68
7.4.210.0090.00616.74
7.4.200.0000.00716.27
7.4.160.0110.00716.57
7.4.150.0090.00917.40
7.4.140.0140.01117.86
7.4.130.0140.00416.63
7.4.120.0110.00616.51
7.4.110.0090.01116.53
7.4.100.0150.00916.37
7.4.90.0110.00716.52
7.4.80.0140.01119.39
7.4.70.0090.00916.48
7.4.60.0070.01016.71
7.4.50.0030.00616.61
7.4.40.0100.00716.46
7.4.30.0110.01016.47
7.4.00.0070.01014.70
7.3.330.0050.00013.13
7.3.320.0050.00013.17
7.3.310.0000.00716.39
7.3.300.0030.00316.24
7.3.290.0090.00716.30
7.3.280.0100.01016.26
7.3.270.0090.00817.40
7.3.260.0110.00816.55
7.3.250.0110.00816.44
7.3.240.0140.00416.27
7.3.230.0120.00916.39
7.3.210.0150.00316.52
7.3.200.0070.01016.27
7.3.190.0030.01316.20
7.3.180.0040.01216.45
7.3.170.0080.00816.30
7.3.160.0060.01116.47
7.3.120.0060.01214.62
7.3.110.0130.00714.77
7.3.100.0080.00614.84
7.3.90.0070.01115.01
7.3.80.0060.01014.86
7.3.70.0070.01014.69
7.3.60.0080.00414.97
7.3.50.0070.00714.70
7.3.40.0030.01214.86
7.3.30.0000.01514.82
7.3.20.0030.00616.41
7.3.10.0030.00716.75
7.3.00.0030.01016.69
7.2.330.0120.00616.46
7.2.320.0100.00616.59
7.2.310.0080.01616.54
7.2.300.0000.01616.28
7.2.290.0160.00716.58
7.2.240.0030.01714.77
7.2.230.0060.01315.04
7.2.220.0100.00715.10
7.2.210.0040.00814.64
7.2.200.0040.01114.89
7.2.190.0030.00814.71
7.2.180.0080.00414.83
7.2.170.0030.01214.94
7.2.160.0110.00314.81
7.2.150.0070.00716.73
7.2.140.0090.00616.52
7.2.130.0000.01416.54
7.2.120.0000.01316.79
7.2.110.0030.00716.78
7.2.100.0100.00016.77
7.2.90.0000.01216.84
7.2.80.0040.00716.69
7.2.70.0050.00516.96
7.2.60.0060.00616.75
7.2.50.0090.00616.87
7.2.40.0040.00816.84
7.2.30.0000.01716.61
7.2.20.0030.01316.87
7.2.10.0060.00616.90
7.2.00.0080.00917.59
7.1.330.0030.01615.56
7.1.320.0100.00715.65
7.1.310.0130.00015.63
7.1.300.0040.01115.74
7.1.290.0030.00715.64
7.1.280.0080.00815.57
7.1.270.0000.00915.39
7.1.260.0060.00915.50
7.1.250.0030.01015.34
7.1.200.0040.00815.70
7.1.70.0060.00917.02
7.1.60.0060.01217.19
7.1.50.0170.01734.76
7.1.00.0070.07322.33
7.0.200.0030.01416.66
7.0.60.0230.06719.93
7.0.50.0070.07717.80
7.0.40.0100.07719.98
7.0.30.0500.07720.10
7.0.20.0170.05020.01
7.0.10.0000.04320.09
7.0.00.0130.07720.16
5.6.280.0000.06320.83
5.6.210.0030.04020.58
5.6.200.0100.07318.19
5.6.190.0100.04020.39
5.6.180.0330.07020.39
5.6.170.0200.04020.51
5.6.160.0130.08020.37
5.6.150.0100.07718.22
5.6.140.0000.04318.15
5.6.130.0000.09018.18
5.6.120.0100.07321.07
5.6.110.0000.04720.98
5.6.100.0000.04321.00
5.6.90.0030.08021.11
5.6.80.0070.07720.43
5.6.70.3030.03720.50
5.5.350.0100.06720.48
5.5.340.0100.08017.95
5.5.330.0030.04020.13
5.5.320.0370.06320.43
5.5.310.0170.03720.50
5.5.300.0000.04017.92
5.5.290.0170.07018.01
5.5.280.0100.08020.89
5.5.270.0030.04320.86
5.5.260.0070.05020.77
5.5.250.0000.08720.51
5.5.240.0100.06320.17
5.4.450.0670.05319.38
5.4.440.0570.06319.45
5.4.430.0800.05319.50
5.4.420.0800.04019.50
5.4.410.0800.05319.38
5.4.400.0730.05718.87
5.4.390.0730.06719.05
5.4.380.0730.05719.15
5.4.370.0670.05719.18
5.4.360.0770.05719.20
5.4.350.0830.05018.76
5.4.340.0800.05718.76
5.4.320.0770.06019.24
5.4.310.0900.04318.99
5.4.300.0730.05718.76
5.4.290.0770.05718.87
5.4.280.0900.05319.03
5.4.270.0930.04718.95
5.4.260.0800.05019.20
5.4.250.0800.05318.75
5.4.240.1070.06719.14
5.4.230.1000.05319.17
5.4.220.0730.06019.14
5.4.210.0930.05718.86
5.4.200.0770.05718.75
5.4.190.0870.04318.97
5.4.180.0870.04319.23
5.4.170.0900.04018.98
5.4.160.0830.05019.13
5.4.150.0730.05719.18
5.4.140.0670.06016.25
5.4.130.0800.04716.38
5.4.120.0700.06716.24
5.4.110.0770.05316.42
5.4.100.0830.05316.23
5.4.90.0770.05316.45
5.4.80.0800.05016.37
5.4.70.0170.03716.48
5.4.60.0200.04316.38
5.4.50.0030.04316.36
5.4.40.0070.04016.47
5.4.30.0000.07316.20
5.4.20.0030.07016.06

preferences:
49.17 ms | 401 KiB | 5 Q