3v4l.org

run code in 300+ PHP versions simultaneously
<?php $customTemplate = " <div> <<This>> <<that>> </div> "; $MyClass = new class{ function get($tag) { if ($tag == 'This') return '<h1>Something</h1>'; if ($tag == 'that') return '<p>For example</p>'; return '**not found**'; } }; function process_template($template, $MyClass, $begin = '<<', $end = '>>') { return preg_replace_callback("/$begin(\w+)$end/", function($var) use ($MyClass) { return $MyClass->get($var[1]); }, $template); } $processed = process_template($customTemplate, $MyClass); var_dump($processed);

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.5.10.0110.00718.72
8.5.00.0080.00720.45
8.4.150.0010.00114.05
8.4.140.0140.00717.82
8.4.130.0140.00917.84
8.4.120.0060.00520.75
8.4.110.0120.01018.71
8.4.100.0080.01018.04
8.4.90.0160.00418.77
8.4.80.0120.00818.09
8.4.70.0160.00117.89
8.4.60.0090.01119.07
8.4.50.0070.00320.65
8.4.40.0130.00719.74
8.4.30.0100.00620.72
8.4.20.0160.00318.71
8.4.10.0070.00418.16
8.3.280.0120.00818.37
8.3.270.0140.00716.79
8.3.260.0070.00916.73
8.3.250.0090.01017.14
8.3.240.0110.00916.72
8.3.230.0100.00916.67
8.3.220.0080.00619.10
8.3.210.0090.01016.78
8.3.200.0050.00416.79
8.3.190.0140.00817.17
8.3.180.0090.00616.67
8.3.170.0140.00418.95
8.3.160.0080.01117.32
8.3.150.0160.00316.95
8.3.140.0110.00716.73
8.3.130.0030.00616.96
8.3.120.0050.00319.31
8.3.110.0090.00020.94
8.3.100.0030.00617.00
8.3.90.0090.00918.80
8.3.80.0070.00418.55
8.3.70.0070.00718.55
8.3.60.0140.00716.75
8.3.50.0090.01021.19
8.3.40.0130.00619.11
8.3.30.0160.00018.94
8.3.20.0040.00421.73
8.3.10.0070.00020.13
8.3.00.0080.00021.69
8.2.290.0070.01220.61
8.2.280.0080.00818.47
8.2.270.0110.00719.15
8.2.260.0080.00016.73
8.2.250.0030.00516.97
8.2.240.0050.00517.34
8.2.230.0100.00022.58
8.2.220.0030.00624.06
8.2.210.0080.00026.77
8.2.200.0030.00618.79
8.2.190.0040.01116.88
8.2.180.0120.00316.75
8.2.170.0150.00622.96
8.2.160.0040.01120.32
8.2.150.0060.00324.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0070.00319.45
8.2.100.0140.00017.97
8.2.90.0080.00019.21
8.2.80.0080.00017.97
8.2.70.0050.00318.05
8.2.60.0000.00918.22
8.2.50.0000.00818.10
8.2.40.0060.00619.28
8.2.30.0030.00519.23
8.2.20.0030.00618.11
8.2.10.0000.00819.26
8.2.00.0080.00019.35
8.1.330.0090.00921.67
8.1.320.0060.01316.37
8.1.310.0050.00318.40
8.1.300.0040.00418.43
8.1.290.0000.01018.88
8.1.280.0090.00625.92
8.1.270.0080.00022.18
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00622.05
8.1.230.0030.01017.83
8.1.220.0030.00617.79
8.1.210.0000.00918.77
8.1.200.0100.00017.60
8.1.190.0030.00617.25
8.1.180.0040.00418.10
8.1.170.0040.00418.63
8.1.160.0060.00320.62
8.1.150.0070.00018.93
8.1.140.0000.00720.95
8.1.130.0080.00020.22
8.1.120.0070.00017.64
8.1.110.0040.00417.50
8.1.100.0040.00417.61
8.1.90.0050.00217.68
8.1.80.0000.00817.54
8.1.70.0000.00717.61
8.1.60.0040.00417.72
8.1.50.0000.00817.68
8.1.40.0040.00417.74
8.1.30.0040.00417.83
8.1.20.0000.00817.79
8.1.10.0030.00517.68
8.1.00.0070.00017.70
8.0.300.0080.00018.77
8.0.290.0000.00817.00
8.0.280.0030.00318.50
8.0.270.0070.00016.86
8.0.260.0000.00620.11
8.0.250.0040.00417.00
8.0.240.0040.00417.09
8.0.230.0000.00717.02
8.0.220.0040.00416.94
8.0.210.0030.00317.07
8.0.200.0030.00617.11
8.0.190.0060.00317.13
8.0.180.0050.00317.11
8.0.170.0060.00317.09
8.0.160.0040.00416.96
8.0.150.0040.00317.01
8.0.140.0080.00017.05
8.0.130.0060.00013.50
8.0.120.0060.00316.98
8.0.110.0050.00217.04
8.0.100.0040.00417.12
8.0.90.0000.00816.94
8.0.80.0040.01116.99
8.0.70.0050.00317.07
8.0.60.0050.00317.10
8.0.50.0000.00817.04
8.0.30.0100.01117.14
8.0.20.0150.00617.38
8.0.10.0050.00217.07
8.0.00.0110.00716.99
7.4.330.0020.00215.55
7.4.320.0030.00316.76
7.4.300.0030.00316.78
7.4.290.0030.00316.81
7.4.280.0080.00016.74
7.4.270.0000.00716.88
7.4.260.0060.00013.43
7.4.250.0050.00316.69
7.4.240.0020.00516.80
7.4.230.0000.00816.72
7.4.220.0020.00516.60
7.4.210.0110.00616.77
7.4.200.0030.00316.91
7.4.140.0090.00917.86
7.4.130.0120.00616.69
7.4.120.0070.01116.83
7.4.110.0050.01416.70
7.4.100.0120.00616.74
7.4.90.0170.00016.91
7.4.80.0060.01819.39
7.4.70.0060.01316.82
7.4.60.0090.00916.73
7.4.50.0130.00316.71
7.4.40.0130.00316.66
7.4.00.0030.01315.24
7.3.330.0070.00016.54
7.3.320.0030.00513.39
7.3.310.0030.00316.40
7.3.300.0000.00716.46
7.3.290.0000.00716.42
7.3.280.0070.01316.38
7.3.260.0080.01316.77
7.3.240.0090.00916.57
7.3.230.0110.00516.59
7.3.210.0110.00716.58
7.3.200.0060.01016.88
7.3.190.0050.01116.75
7.3.180.0080.00816.73
7.3.170.0140.00316.65
7.3.160.0030.01316.63
7.3.70.0140.00514.92
7.3.60.0080.00614.94
7.3.50.0080.00614.88
7.3.40.0060.00914.85
7.3.30.0040.00814.96
7.3.20.0120.00516.87
7.3.10.0070.00816.62
7.3.00.0050.00816.79
7.2.330.0120.00616.96
7.2.320.0060.01016.88
7.2.310.0040.01216.86
7.2.300.0030.01216.82
7.2.290.0110.00516.89
7.2.200.0050.01015.17
7.2.190.0060.00915.18
7.2.180.0050.01015.20
7.2.170.0080.00815.08
7.2.160.0110.00115.30
7.2.150.0030.01017.29
7.2.140.0080.00816.81
7.2.130.0060.00717.05
7.2.120.0120.00516.94
7.2.110.0100.00716.90
7.2.100.0120.00317.02
7.2.90.0050.00917.14
7.2.80.0050.01317.11
7.2.70.0110.00617.04
7.2.60.0110.00817.18
7.2.50.0100.00716.99
7.2.40.0080.00517.06
7.2.30.0080.00617.14
7.2.20.0080.00916.83
7.2.10.0050.00917.04
7.2.00.0090.00716.98
7.1.300.0040.01215.90
7.1.290.0050.01015.92
7.1.280.0070.00716.00
7.1.270.0080.00515.72
7.1.260.0040.00715.85
7.1.250.0070.00515.85

preferences:
34.49 ms | 403 KiB | 5 Q