3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RenderEngine { private $blocks = []; public function block($name, $callback) { $this->blocks[$name] = $callback; } public function draw($name, array $args) { call_user_func_args($this->blocks[$name], $args); } } $t = new RenderEngine(); ?> <?php $t->block('article', function ($article) { ?> <?=$article;?> <?php }); ?> <?=$t->draw('article', ['hello']);?>

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.40.0080.00818.84
8.3.30.0140.00018.80
8.3.20.0040.00420.16
8.3.10.0040.00423.70
8.3.00.0030.00619.38
8.2.170.0090.00622.96
8.2.160.0100.00720.35
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0060.00317.75
8.2.110.0040.00421.11
8.2.100.0040.00717.91
8.2.90.0000.00818.22
8.2.80.0040.00418.16
8.2.70.0050.00317.91
8.2.60.0080.00017.93
8.2.50.0040.00418.10
8.2.40.0040.00420.59
8.2.30.0000.00820.66
8.2.20.0030.00717.73
8.2.10.0040.00418.14
8.2.00.0040.00418.01
8.1.270.0030.00623.96
8.1.260.0040.01126.35
8.1.250.0120.00828.09
8.1.240.0060.00322.55
8.1.230.0090.00322.75
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0090.00017.23
8.1.190.0040.00417.13
8.1.180.0050.00318.10
8.1.170.0040.00418.46
8.1.160.0000.00722.22
8.1.150.0090.00019.02
8.1.140.0060.00321.40
8.1.130.0040.00419.32
8.1.120.0000.00717.48
8.1.110.0060.00317.37
8.1.100.0080.00017.45
8.1.90.0000.00717.47
8.1.80.0050.00317.36
8.1.70.0000.00817.48
8.1.60.0040.00417.51
8.1.50.0000.01117.62
8.1.40.0000.00817.52
8.1.30.0000.00917.75
8.1.20.0030.00617.63
8.1.10.0050.00317.61
8.1.00.0020.00517.51
8.0.300.0040.00420.03
8.0.290.0060.00316.75
8.0.280.0080.00018.34
8.0.270.0040.00417.30
8.0.260.0000.00616.77
8.0.250.0030.00516.91
8.0.240.0030.00316.84
8.0.230.0080.00016.97
8.0.220.0030.00316.89
8.0.210.0000.00716.78
8.0.200.0000.00816.99
8.0.190.0050.00217.00
8.0.180.0040.00416.89
8.0.170.0050.00316.86
8.0.160.0050.00316.95
8.0.150.0040.00416.92
8.0.140.0040.00416.95
8.0.130.0030.00313.39
8.0.120.0040.00416.84
8.0.110.0000.00816.98
8.0.100.0050.00317.01
8.0.90.0070.00016.80
8.0.80.0160.00316.97
8.0.70.0000.00716.80
8.0.60.0050.00216.84
8.0.50.0040.00416.81
8.0.30.0100.00817.13
8.0.20.0100.00817.40
8.0.10.0000.00716.89
8.0.00.0090.00916.84
7.4.330.0000.00515.14
7.4.320.0030.00516.44
7.4.300.0030.00316.59
7.4.290.0030.00316.61
7.4.280.0070.00016.56
7.4.270.0040.00416.45
7.4.260.0000.01116.61
7.4.250.0000.00716.55
7.4.240.0020.00516.55
7.4.230.0070.00016.66
7.4.220.0110.00816.56
7.4.210.0090.01016.69
7.4.200.0040.00216.43
7.4.160.0080.00816.42
7.4.150.0070.01317.40
7.4.140.0120.00917.86
7.4.130.0090.01116.52
7.4.120.0110.00816.54
7.4.110.0070.01116.49
7.4.100.0000.01716.75
7.4.90.0070.01016.45
7.4.80.0090.00919.39
7.4.70.0090.01316.83
7.4.60.0040.01216.49
7.4.50.0050.00316.28
7.4.40.0110.00816.44
7.4.30.0080.00816.65
7.4.00.0090.00914.86
7.3.330.0030.00313.39
7.3.320.0030.00313.41
7.3.310.0030.00316.45
7.3.300.0020.00516.55
7.3.290.0070.00716.41
7.3.280.0070.00916.41
7.3.270.0070.01717.40
7.3.260.0100.00716.45
7.3.250.0160.00316.56
7.3.240.0180.00116.49
7.3.230.0100.00716.40
7.3.210.0100.00816.46
7.3.200.0100.01016.52
7.3.190.0110.00716.43
7.3.180.0080.00816.52
7.3.170.0100.00716.58
7.3.160.0030.01516.54
7.3.10.0150.00916.29
7.3.00.0150.00416.57
7.2.330.0120.00616.40
7.2.320.0130.00316.51
7.2.310.0060.01016.68
7.2.300.0100.01016.58
7.2.290.0110.00716.80
7.2.130.0090.00816.55
7.2.120.0130.00716.58
7.2.110.0100.00516.58
7.2.100.0080.00716.58
7.2.90.0100.00816.74
7.2.80.0080.00716.58
7.2.70.0080.00616.63
7.2.60.0110.00816.84
7.2.50.0080.00916.66
7.2.40.0110.00816.73
7.2.30.0100.00916.71
7.2.20.0120.00516.78
7.2.10.0070.00516.54
7.2.00.0040.01117.71
7.1.250.0130.00315.41
7.1.240.0140.00415.83
7.1.230.0070.00715.91
7.1.220.0070.01015.69
7.1.210.0040.01115.59
7.1.200.0060.00515.77
7.1.190.0040.00815.91
7.1.180.0060.00615.57
7.1.170.0040.00815.66
7.1.160.0060.00915.68
7.1.150.0090.00615.87
7.1.140.0060.00615.80
7.1.130.0120.00415.79
7.1.120.0070.01015.54
7.1.110.0080.00315.88
7.1.100.0030.01116.99
7.1.90.0040.00715.56
7.1.80.0080.00415.78
7.1.70.0030.01116.37
7.1.60.0060.00617.43
7.1.50.0090.00816.40
7.1.40.0050.00315.56
7.1.30.0070.00715.52
7.1.20.0050.00315.80
7.1.10.0040.00815.70
7.1.00.0100.03719.18
7.0.330.0110.00415.02
7.0.320.0030.00715.05
7.0.310.0070.00715.25
7.0.300.0030.00915.21
7.0.290.0120.00315.30
7.0.280.0000.01215.23
7.0.270.0000.00814.88
7.0.260.0070.00315.39
7.0.250.0040.00815.25
7.0.240.0000.01415.02
7.0.230.0000.01415.32
7.0.220.0070.00715.26
7.0.210.0060.00615.25
7.0.200.0050.00614.90
7.0.190.0070.00715.09
7.0.180.0110.00315.37
7.0.170.0130.00615.20
7.0.160.0040.00815.08
7.0.150.0110.00014.95
7.0.140.0070.00015.23
7.0.130.0210.00015.25
7.0.120.0050.00315.11
7.0.110.0100.00715.25
7.0.100.0100.00715.26
7.0.90.0030.00615.21
7.0.80.0130.00315.20
7.0.70.0000.01715.12
7.0.60.0050.04717.63
7.0.50.0090.02816.62
7.0.40.0120.04016.56
7.0.30.0320.04016.66
7.0.20.0200.03816.73
7.0.10.0200.04216.82
7.0.00.0020.05116.79
5.6.380.0030.01014.45
5.6.370.0060.00914.23
5.6.360.0030.00614.23
5.6.350.0040.00814.03
5.6.340.0090.00314.06
5.6.330.0090.00014.09
5.6.320.0040.00814.06
5.6.310.0080.00014.22
5.6.300.0000.01113.93
5.6.290.0070.00713.95
5.6.280.0030.02817.48
5.6.270.0100.00314.10
5.6.260.0090.00614.21
5.6.250.0000.00914.24
5.6.240.0070.01014.15
5.6.230.0030.00914.09
5.6.220.0080.00414.07
5.6.210.0100.03017.30
5.6.200.0080.03416.25
5.6.190.0080.02617.45
5.6.180.0180.04017.46
5.6.170.0080.02917.39
5.6.160.0050.02917.27
5.6.150.0000.05016.14
5.6.140.0050.04416.27
5.6.130.0020.04716.20
5.6.120.0080.04517.74
5.6.110.0050.04017.45
5.6.100.0100.02817.74
5.6.90.0050.02517.69
5.6.80.0080.04017.30
5.6.70.0180.04517.41
5.6.60.0110.00514.18
5.6.50.0150.00514.05
5.6.40.0130.00814.33
5.6.30.0130.00814.23
5.6.20.0120.01014.32
5.6.10.0120.01314.35
5.6.00.0070.01214.37
5.5.380.0060.00010.90
5.5.370.0040.00711.18
5.5.360.0070.00011.00
5.5.350.0200.04015.78
5.5.340.0050.04214.56
5.5.330.0070.04215.60
5.5.320.0100.04315.61
5.5.310.0110.02115.66
5.5.300.0130.03614.44
5.5.290.0030.03014.43
5.5.280.0050.04415.90
5.5.270.0100.03016.07
5.5.260.0020.04816.02
5.5.250.0090.03615.89
5.5.240.0050.03215.54
5.5.230.0040.00910.90
5.5.220.0030.00611.17
5.5.210.0100.00011.01
5.5.200.0070.00311.24
5.5.190.0060.00611.13
5.5.180.0030.00911.00
5.5.170.0040.00810.90
5.5.160.0030.00910.90
5.5.150.0100.00011.22
5.5.140.0040.00711.30
5.5.130.0100.00010.90
5.5.120.0060.00610.90
5.5.110.0000.01010.90
5.5.100.0060.00610.90
5.5.90.0090.00311.24
5.5.80.0060.00611.05
5.5.70.0040.00711.05
5.5.60.0080.00511.18
5.5.50.0060.00611.28
5.5.40.0080.00511.10
5.5.30.0130.00010.90
5.5.20.0030.00811.19
5.5.10.0030.00910.95
5.5.00.0030.00611.07
5.4.450.0270.03715.43
5.4.440.0120.03815.25
5.4.430.0170.03515.50
5.4.420.0110.02815.43
5.4.410.0070.03214.96
5.4.400.0110.02515.02
5.4.390.0240.03315.21
5.4.380.0080.03514.95
5.4.370.0170.03415.06
5.4.360.0140.02815.14
5.4.350.0430.03015.09
5.4.340.0340.03715.13
5.4.330.0080.00811.02
5.4.320.0130.02715.06
5.4.310.0110.03314.86
5.4.300.0100.02915.29
5.4.290.0050.03214.86
5.4.280.0050.03115.12
5.4.270.0330.01715.13
5.4.260.0170.02215.15
5.4.250.0120.03215.01
5.4.240.0050.03015.02
5.4.230.0330.02815.00
5.4.220.0420.02815.06
5.4.210.0100.03715.00
5.4.200.0170.03115.01
5.4.190.0180.03515.08
5.4.180.0180.03214.87
5.4.170.0180.03015.07
5.4.160.0110.03714.92
5.4.150.0170.03415.03
5.4.140.0130.03413.65
5.4.130.0170.03913.69
5.4.120.0100.03613.62
5.4.110.0150.04413.72
5.4.100.0120.02513.68
5.4.90.0150.03713.66
5.4.80.0440.02613.63
5.4.70.0370.03013.76
5.4.60.0480.02613.75
5.4.50.0400.03013.75
5.4.40.0110.02513.68
5.4.30.0140.02713.65
5.4.20.0090.03113.82
5.4.10.0150.02913.73
5.4.00.0070.03113.35

preferences:
51.65 ms | 400 KiB | 5 Q