3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface LifeCycleListener { function before(); function after(); } class LifeCycler { private $listeners = []; public function run(callable $x) { foreach ($this->listeners as $l) $l->before(); $x(); foreach ($this->listeners as $l) $l->after(); } public function addListener(LifeCycleListener $listener) { $this->listeners[] = $listener; } } $lc = new LifeCycler(); $lc->addListener(new class implements LifeCycler { function before() { echo "before!\n"; } function after() { echo "after!\n"; } }); $lc->run(function() { echo "running!\n"; });

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.0110.01118.75
8.3.30.0140.00718.68
8.3.20.0040.00420.30
8.3.10.0050.00323.48
8.3.00.0000.00819.38
8.2.170.0120.00322.96
8.2.160.0130.00321.84
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0060.00619.36
8.2.120.0000.00826.35
8.2.110.0040.00422.20
8.2.100.0080.00317.92
8.2.90.0040.00419.05
8.2.80.0050.00317.97
8.2.70.0030.00617.75
8.2.60.0000.00817.80
8.2.50.0050.00318.07
8.2.40.0060.00319.45
8.2.30.0000.00720.64
8.2.20.0000.00817.73
8.2.10.0040.00418.12
8.2.00.0040.00417.98
8.1.270.0100.01023.99
8.1.260.0020.00528.09
8.1.250.0000.00828.09
8.1.240.0090.00022.53
8.1.230.0130.00017.42
8.1.220.0000.00817.79
8.1.210.0090.00018.77
8.1.200.0030.00617.35
8.1.190.0000.00817.13
8.1.180.0030.00618.10
8.1.170.0070.00020.07
8.1.160.0040.00422.02
8.1.150.0040.00418.80
8.1.140.0000.00717.46
8.1.130.0000.00717.61
8.1.120.0050.00317.39
8.1.110.0060.00317.49
8.1.100.0080.00017.33
8.1.90.0030.00517.41
8.1.80.0030.00517.34
8.1.70.0070.00017.46
8.1.60.0030.00617.57
8.1.50.0000.00817.46
8.1.40.0060.00317.50
8.1.30.0000.00817.65
8.1.20.0000.00717.55
8.1.10.0080.00017.54
8.1.00.0040.00417.46
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.45
8.0.270.0070.00016.88
8.0.260.0030.00317.27
8.0.250.0040.00416.94
8.0.240.0030.00316.89
8.0.230.0040.00416.93
8.0.220.0030.00316.88
8.0.210.0000.00716.86
8.0.200.0060.00016.98
8.0.190.0000.00816.95
8.0.180.0000.00716.97
8.0.170.0000.00716.96
8.0.160.0070.00017.07
8.0.150.0000.00717.03
8.0.140.0050.00216.93
8.0.130.0000.00513.32
8.0.120.0050.00316.81
8.0.110.0040.00416.93
8.0.100.0040.00416.81
8.0.90.0040.00416.92
8.0.80.0080.00716.99
8.0.70.0050.00216.91
8.0.60.0000.00816.96
8.0.50.0040.00416.94
8.0.30.0090.00917.16
8.0.20.0130.00817.40
8.0.10.0080.00016.95
8.0.00.0110.00816.80
7.4.330.0050.00016.67
7.4.320.0030.00316.50
7.4.300.0000.00716.43
7.4.290.0000.00716.58
7.4.280.0040.00416.51
7.4.270.0070.00016.63
7.4.260.0000.00816.50
7.4.250.0040.00416.57
7.4.240.0040.00316.50
7.4.230.0000.00816.70
7.4.220.0070.01116.58
7.4.210.0030.01016.63
7.4.200.0070.00016.56
7.4.160.0120.00416.43
7.4.150.0090.00917.40
7.4.140.0100.01417.86
7.4.130.0080.01016.58
7.4.120.0130.00616.60
7.4.110.0150.00316.48
7.4.100.0120.00916.48
7.4.90.0070.01016.59
7.4.80.0030.01619.39
7.4.70.0090.01316.63
7.4.60.0100.00716.49
7.4.50.0060.01216.34
7.4.40.0110.00616.48
7.4.30.0100.00716.39
7.4.10.0070.01114.89
7.4.00.0050.01214.83
7.3.330.0000.00513.16
7.3.320.0060.00013.39
7.3.310.0030.00316.32
7.3.300.0000.00716.18
7.3.290.0040.01116.26
7.3.280.0130.00716.30
7.3.270.0070.01017.40
7.3.260.0140.00316.31
7.3.250.0070.01016.29
7.3.240.0120.00516.34
7.3.230.0090.00616.39
7.3.210.0110.00616.45
7.3.200.0100.00716.48
7.3.190.0060.01016.40
7.3.180.0020.01516.42
7.3.170.0100.00616.29
7.3.160.0130.00316.29
7.3.130.0120.00314.76
7.3.120.0100.00614.46
7.3.110.0070.01114.81
7.3.100.0040.01114.82
7.3.90.0050.00514.97
7.3.80.0040.00414.75
7.3.70.0060.00614.88
7.3.60.0070.00714.77
7.3.50.0090.00914.80
7.3.40.0030.01314.81
7.3.30.0040.00814.80
7.3.20.0070.00716.42
7.3.10.0000.01716.66
7.3.00.0030.00716.51
7.2.330.0140.01016.38
7.2.320.0100.01016.70
7.2.310.0170.00016.64
7.2.300.0030.02016.68
7.2.290.0120.00616.62
7.2.260.0060.01215.14
7.2.250.0030.01414.91
7.2.240.0100.00314.72
7.2.230.0090.00614.96
7.2.220.0000.01515.08
7.2.210.0000.01415.01
7.2.200.0090.00615.15
7.2.190.0040.01114.96
7.2.180.0030.01514.89
7.2.170.0060.00615.04
7.2.160.0000.01814.86
7.2.150.0080.00817.02
7.2.140.0070.01116.77
7.2.130.0090.00616.92
7.2.120.0040.01116.92
7.2.110.0070.00716.83
7.2.100.0090.00616.85
7.2.90.0060.01217.06
7.2.80.0070.00716.80
7.2.70.0030.01316.85
7.2.60.0040.00616.72
7.2.50.0090.00316.49
7.2.40.0030.01316.80
7.2.30.0090.00616.68
7.2.20.0100.00716.79
7.2.10.0040.01116.88
7.2.00.0110.00917.59
7.1.330.0060.00915.52
7.1.320.0030.01015.74
7.1.310.0030.01015.64
7.1.300.0000.00815.38
7.1.290.0060.01215.70
7.1.280.0030.01015.91
7.1.270.0140.00315.73
7.1.260.0000.01215.56
7.1.250.0000.01415.73
7.1.240.0040.00415.87
7.1.230.0120.00315.68
7.1.220.0050.00515.50
7.1.210.0110.00415.57
7.1.200.0050.00515.40
7.1.190.0110.00315.71
7.1.180.0030.00615.66
7.1.170.0070.00715.77
7.1.160.0100.00715.79
7.1.150.0120.00315.77
7.1.140.0080.00815.41
7.1.130.0040.01115.85
7.1.120.0070.00315.70
7.1.110.0030.00715.78
7.1.100.0070.00716.91
7.1.90.0130.00315.62
7.1.80.0100.00015.84
7.1.70.0010.00816.27
7.1.60.0100.00817.52
7.1.50.0060.00516.23
7.1.40.0040.01215.84
7.1.30.0040.00815.46
7.1.20.0000.01115.65
7.1.10.0000.00815.70
7.1.00.0030.04219.06
7.0.330.0030.00615.27
7.0.320.0080.00015.07
7.0.310.0040.00815.05
7.0.300.0070.00715.44
7.0.290.0110.00415.23
7.0.280.0040.00415.44
7.0.270.0030.01015.34
7.0.260.0000.00815.29
7.0.250.0130.00315.16
7.0.240.0090.00915.46
7.0.230.0000.01115.38
7.0.220.0060.00315.31
7.0.210.0100.00615.47
7.0.200.0060.00614.92
7.0.190.0090.00315.37
7.0.180.0060.00915.27
7.0.170.0030.01015.14
7.0.160.0090.00615.32
7.0.150.0100.00315.31
7.0.140.0060.00615.35
7.0.130.0070.00315.14
7.0.120.0040.00715.27
7.0.110.0030.01215.45
7.0.100.0040.00815.23
7.0.90.0090.00315.34
7.0.80.0000.01315.36
7.0.70.0070.00715.50
7.0.60.0050.04917.40
7.0.50.0070.04016.61
7.0.40.0030.02616.66
7.0.30.0120.03716.69
7.0.20.0120.02516.56
7.0.10.0020.04916.63
7.0.00.0050.04716.73
5.6.400.0030.01014.10
5.6.390.0060.00914.09
5.6.380.0030.00614.19
5.6.370.0000.00914.17
5.6.360.0110.00014.42
5.6.350.0000.00914.45
5.6.340.0030.00514.07
5.6.330.0030.01413.89
5.6.320.0110.00414.18
5.6.310.0070.00714.10
5.6.300.0060.00614.21
5.6.290.0030.00514.24
5.6.280.0020.04417.65
5.6.270.0000.01014.37
5.6.260.0040.00814.10
5.6.250.0030.00614.11
5.6.240.0080.00314.38
5.6.230.0030.01213.87
5.6.220.0040.00714.20
5.6.210.0050.02517.26
5.6.200.0070.02216.17
5.6.190.0030.03517.32
5.6.180.0130.04517.35
5.6.170.0170.03517.23
5.6.160.0020.03217.28
5.6.150.0130.03816.02
5.6.140.0050.04316.12
5.6.130.0030.04916.23
5.6.120.0090.04417.58
5.6.110.0110.02217.68
5.6.100.0150.02517.59
5.6.90.0030.05117.53
5.6.80.0090.02017.15
5.6.70.0070.00413.80
5.6.60.0000.00913.92
5.6.50.0060.00613.87
5.6.40.0030.00613.93
5.6.30.0000.01414.10
5.6.20.0000.01414.14
5.6.10.0090.00013.98
5.6.00.0030.01014.09
5.5.380.0040.00813.82
5.5.370.0040.01213.95
5.5.360.0000.01213.95
5.5.350.1950.02417.05
5.5.340.0020.03516.24
5.5.330.0120.04517.23
5.5.320.0110.03317.27
5.5.310.0120.04517.16
5.5.300.0050.04116.05
5.5.290.0050.03815.98
5.5.280.0060.02517.34
5.5.270.0050.04517.50
5.5.260.0050.04617.25
5.5.250.0020.02917.25
5.5.240.0070.05016.99
5.5.230.0040.00414.16
5.5.220.0000.01113.85
5.5.210.0060.01014.11
5.5.200.0030.00914.15
5.5.190.0030.00714.18
5.5.180.0090.00613.85
5.5.170.0070.00714.11
5.5.160.0030.00613.85
5.5.150.0000.00913.85
5.5.140.0060.00614.00
5.5.130.0050.00513.96
5.5.120.0060.00613.84
5.5.110.0060.00614.13
5.5.100.0080.00313.91
5.5.90.0070.00714.13
5.5.80.0030.00613.97
5.5.70.0080.00613.79
5.5.60.0100.00313.75
5.5.50.0090.00314.02
5.5.40.0060.01013.86
5.5.30.0000.01313.90
5.5.20.0000.01114.08
5.5.10.0030.00913.98
5.5.00.0120.00013.97

preferences:
47.81 ms | 400 KiB | 5 Q