3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('SITE_URL', 'http://example.com'); $vars = [ 'SITE_URL' => SITE_URL ]; $template = '<p class="card mb-4 shadow-sm"><img src="{{ SITE_URL }}/assets/images/blog/php.png" alt="php" title="php"></p>'; // match any single word with _ or -, with spaces either side or not // e.g: {{key}} or {{ key }} or {{key-foo}} or {{ key-foo }} // not {{ a b c }} $str = preg_replace_callback("/\{\{[ ]{0,}([\w\_-]{1,})[ ]{0,1}\}\}/", function ($match) use ($vars) { return array_key_exists($match[1], $vars) ? $vars[$match[1]] : ''; }, $template); echo $str;

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.4.130.0070.00318.12
8.4.120.0150.00520.35
8.4.110.0120.00918.70
8.4.100.0140.00517.99
8.4.90.0120.00820.79
8.4.80.0040.00518.73
8.4.70.0080.00718.88
8.4.60.0120.01118.98
8.4.50.0080.00818.86
8.4.40.0120.00917.75
8.4.30.0110.00917.98
8.4.20.0100.01020.50
8.4.10.0040.01117.90
8.3.260.0090.01016.58
8.3.250.0120.00718.91
8.3.240.0040.00416.68
8.3.230.0050.00516.83
8.3.220.0050.00218.97
8.3.210.0050.00318.46
8.3.200.0050.00416.76
8.3.190.0120.00916.92
8.3.180.0050.00618.91
8.3.170.0190.00016.79
8.3.160.0030.01517.46
8.3.150.0180.00018.78
8.3.140.0070.01316.79
8.3.130.0060.00318.48
8.3.120.0120.00418.77
8.3.110.0160.00320.94
8.3.100.0060.00324.06
8.3.90.0090.00926.77
8.3.80.0070.00316.75
8.3.70.0110.00718.68
8.3.60.0030.01718.55
8.3.50.0080.00518.21
8.3.40.0060.01318.92
8.3.30.0060.00918.96
8.3.20.0040.00419.14
8.3.10.0040.00423.29
8.3.00.0040.00422.50
8.2.290.0070.00316.60
8.2.280.0120.00718.37
8.2.270.0120.00616.82
8.2.260.0030.00516.97
8.2.250.0060.00318.79
8.2.240.0100.00617.11
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0090.00026.77
8.2.200.0080.00016.63
8.2.190.0090.00617.00
8.2.180.0080.00818.79
8.2.170.0140.00422.96
8.2.160.0040.01121.21
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00721.07
8.2.110.0060.00321.25
8.2.100.0120.00217.82
8.2.90.0050.00319.20
8.2.80.0030.00517.98
8.2.70.0080.00017.88
8.2.60.0080.00017.75
8.2.50.0030.00618.05
8.2.40.0080.00019.63
8.2.30.0040.00420.60
8.2.20.0040.00418.23
8.2.10.0060.00318.08
8.2.00.0020.00519.63
8.1.330.0120.00916.16
8.1.320.0060.00218.25
8.1.310.0070.00718.09
8.1.300.0000.00918.39
8.1.290.0030.00618.88
8.1.280.0070.00725.92
8.1.270.0120.00322.13
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0100.00023.79
8.1.230.0110.00017.83
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0120.00317.35
8.1.180.0000.00818.10
8.1.170.0080.00017.62
8.1.160.0040.00418.97
8.1.150.0000.00718.93
8.1.140.0030.00618.93
8.1.130.0000.00720.70
8.1.120.0080.00017.65
8.1.110.0040.00417.55
8.1.100.0040.00417.66
8.1.90.0000.00717.55
8.1.80.0080.00017.61
8.1.70.0050.00217.57
8.1.60.0000.00917.78
8.1.50.0030.00717.74
8.1.40.0040.00417.64
8.1.30.0030.00517.87
8.1.20.0040.00417.84
8.1.10.0030.00517.61
8.1.00.0050.00317.55
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.39
8.0.270.0030.00317.23
8.0.260.0000.00818.99
8.0.250.0070.00017.11
8.0.240.0000.00716.98
8.0.230.0000.00717.11
8.0.220.0030.00516.95
8.0.210.0040.00417.09
8.0.200.0070.00017.13
8.0.190.0030.00517.16
8.0.180.0000.00717.07
8.0.170.0060.00317.08
8.0.160.0030.00616.95
8.0.150.0000.00816.98
8.0.140.0040.00416.98
8.0.130.0000.00513.44
8.0.120.0050.00317.03
8.0.110.0040.00417.06
8.0.100.0080.00017.11
8.0.90.0000.00816.95
8.0.80.0080.01017.03
8.0.70.0000.00717.05
8.0.60.0070.00016.90
8.0.50.0020.00516.99
8.0.30.0110.00917.11
8.0.20.0130.00617.40
8.0.10.0070.00017.07
8.0.00.0100.00817.00
7.4.330.0000.00815.55
7.4.320.0000.00616.82
7.4.300.0000.00716.87
7.4.290.0040.00416.75
7.4.280.0000.00716.86
7.4.270.0070.00316.71
7.4.260.0040.00416.70
7.4.250.0000.00716.76
7.4.240.0040.00416.88
7.4.230.0040.00416.75
7.4.220.0080.00016.61
7.4.210.0080.00716.83
7.4.200.0040.00416.73
7.4.160.0120.00616.70
7.4.140.0090.01117.86
7.4.130.0180.00716.77
7.4.120.0090.01216.69
7.4.110.0000.01616.65
7.4.100.0150.00616.83
7.4.90.0100.00716.61
7.4.80.0090.00919.39
7.4.70.0180.00316.80
7.4.60.0150.00016.68
7.4.50.0040.01416.56
7.4.40.0090.01316.61
7.4.10.0030.01415.25
7.4.00.0080.01015.17
7.3.330.0030.00313.59
7.3.320.0070.00013.59
7.3.310.0000.00716.41
7.3.300.0050.00216.39
7.3.290.0000.00716.45
7.3.280.0070.00916.47
7.3.260.0090.00916.72
7.3.240.0110.00816.57
7.3.230.0130.01316.60
7.3.210.0090.00916.41
7.3.200.0100.00716.84
7.3.190.0090.00616.71
7.3.180.0100.00716.82
7.3.170.0120.00416.77
7.3.160.0180.00316.58
7.3.130.0090.00915.30
7.3.120.0040.00714.89
7.3.110.0160.00315.05
7.3.100.0000.01414.61
7.3.90.0000.01414.99
7.3.80.0130.00314.80
7.3.70.0070.00715.14
7.3.60.0060.00315.10
7.3.50.0030.00715.08
7.3.40.0030.01214.91
7.3.30.0070.00714.94
7.3.20.0000.01316.93
7.3.10.0080.00416.80
7.3.00.0020.01016.76
7.2.330.0170.00716.82
7.2.320.0060.01316.81
7.2.310.0130.00316.77
7.2.300.0090.00916.73
7.2.290.0060.01116.98
7.2.260.0070.01015.09
7.2.250.0060.01215.23
7.2.240.0040.00914.98
7.2.230.0100.01015.30
7.2.220.0060.00915.09
7.2.210.0100.00715.32
7.2.200.0030.00915.21
7.2.190.0000.01415.31
7.2.180.0090.00415.14
7.2.170.0000.01415.39
7.2.160.0040.00814.98
7.2.150.0040.00817.05
7.2.140.0040.01116.93
7.2.130.0060.00517.28
7.2.120.0080.00417.13
7.2.110.0110.00517.01
7.2.100.0020.00917.09
7.2.90.0230.00916.33
7.2.80.0410.00516.17
7.2.70.0310.01016.46
7.2.60.0290.01016.40
7.2.50.0580.00716.35
7.2.40.0320.00916.50
7.2.30.0310.00816.45
7.2.20.0260.01016.22
7.2.10.0250.00916.40
7.2.00.0330.00716.43
7.1.330.0120.00016.01
7.1.320.0120.00616.02
7.1.310.0030.01015.85
7.1.300.0030.00715.66
7.1.290.0140.00015.80
7.1.280.0030.01015.89
7.1.270.0070.00415.70
7.1.260.0080.00615.89
7.1.250.0030.01016.07
7.1.240.0070.00715.88
7.1.230.0110.00415.70
7.1.220.0040.00416.02
7.1.210.0390.00215.01
7.1.200.0500.01014.78
7.1.190.0380.00914.62
7.1.180.0420.01114.96
7.1.170.0530.00514.90
7.1.160.0370.00814.85
7.1.150.0430.00414.94
7.1.140.0450.00714.95
7.1.130.0420.00514.76
7.1.120.0390.00914.97
7.1.110.0500.00714.83
7.1.100.0640.01314.95
7.1.90.0460.00914.77
7.1.80.0460.00814.98
7.1.70.0780.01014.79
7.1.60.0590.01123.68
7.1.50.0500.00823.96
7.1.40.0450.00923.96
7.1.30.0510.00423.79
7.1.20.0650.00523.96
7.1.10.0470.00814.78
7.1.00.0370.00915.04
7.0.330.0000.01415.67
7.0.320.0000.01215.77
7.0.310.0030.00915.38
7.0.300.0060.00615.78
7.0.290.0030.01015.69
7.0.280.0060.00915.56
7.0.270.0030.01015.72
7.0.260.0140.00415.57
7.0.250.0040.01215.63
7.0.240.0060.00615.71
7.0.230.0060.00315.25
7.0.220.0030.00915.44
7.0.210.0030.01015.67
7.0.200.0000.01015.55
7.0.190.0060.00315.57
7.0.180.0050.00515.58
7.0.170.0040.01115.67
7.0.160.0030.00615.52
7.0.150.0080.00415.75
7.0.140.0030.01415.59
7.0.130.0100.00315.75
7.0.120.0000.00915.34
7.0.110.0000.01215.63
7.0.100.0000.01015.45
7.0.90.0030.01015.59
7.0.80.0060.00615.51
7.0.70.0040.00415.75
7.0.60.0030.01015.58
7.0.50.0070.00715.83
7.0.40.0000.00813.80
7.0.30.0070.01013.78
7.0.20.0030.01413.61
7.0.10.0070.00713.56
7.0.00.0080.00013.80
5.6.400.0030.01114.48
5.6.390.0000.01214.18
5.6.380.0100.00314.91
5.6.370.0060.00914.22
5.6.360.0080.00414.32
5.6.350.0000.01414.64
5.6.340.0060.00314.05
5.6.330.0070.00714.71
5.6.320.0030.00914.38
5.6.310.0090.00614.37
5.6.300.0040.01114.45
5.6.290.0000.01614.64
5.6.280.0000.01514.50
5.6.270.0100.00314.61
5.6.260.0000.01414.37
5.6.250.0040.01114.43
5.6.240.0000.00914.29
5.6.230.0060.00614.41
5.6.220.0080.00414.54
5.6.210.0070.00714.52
5.6.200.0060.00614.50
5.6.190.0000.01414.34
5.6.180.0030.01214.44
5.6.170.0040.01214.52
5.6.160.0100.00314.36
5.6.150.0000.01314.56
5.6.140.0090.00314.35
5.6.130.0030.00914.42
5.6.120.0080.00514.41
5.6.110.0070.00714.30
5.6.100.0000.00914.52
5.6.90.0070.00714.28
5.6.80.0070.00714.62
5.6.70.0140.00014.55
5.6.60.0080.00814.50
5.6.50.0110.00414.40
5.6.40.0180.00014.27
5.6.30.0000.01514.11
5.6.20.0030.01314.46
5.6.10.0150.00014.34
5.6.00.0060.00314.17

preferences:
28.41 ms | 403 KiB | 5 Q