3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class EventManagerBase { abstract protected function attach(string $event); } final class EventManager extends EventManagerBase { protected function attach(string $event) { echo "attaching $event\n"; } } final class EventConfigurator extends EventManagerBase { private EventManagerBase $eventManager; public function __construct(EventManagerBase $eventManager, array $config) { $this->eventManager = $eventManager; foreach ($config as $event) { $this->attach($event); } } protected function attach(string $event) { $this->eventManager->attach($event); } } $eventManager = new EventManager(); $configurator = new EventConfigurator($eventManager, ['event1', 'event2']);

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.0140.00416.74
8.3.50.0150.00616.54
8.3.40.0110.00819.32
8.3.30.0040.01218.63
8.3.20.0030.00524.18
8.3.10.0030.00524.66
8.3.00.0040.00426.16
8.2.180.0120.00925.92
8.2.170.0070.00722.96
8.2.160.0120.00322.96
8.2.150.0080.00025.66
8.2.140.0030.00524.66
8.2.130.0000.00726.16
8.2.120.0040.00426.16
8.2.110.0060.00321.05
8.2.100.0030.00917.91
8.2.90.0040.00417.84
8.2.80.0050.00319.23
8.2.70.0050.00317.63
8.2.60.0000.00817.63
8.2.50.0080.00018.05
8.2.40.0040.00418.22
8.2.30.0060.00318.02
8.2.20.0040.00418.13
8.2.10.0040.00419.14
8.2.00.0050.00319.17
8.1.280.0100.00725.92
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0110.01117.25
8.1.230.0080.00422.81
8.1.220.0000.00817.75
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0040.00418.80
8.1.150.0040.00418.95
8.1.140.0000.00718.79
8.1.130.0040.00420.07
8.1.120.0030.00317.38
8.1.110.0000.00817.30
8.1.100.0050.00317.47
8.1.90.0030.00417.36
8.1.80.0040.00417.37
8.1.70.0030.00517.48
8.1.60.0060.00317.59
8.1.50.0080.00017.54
8.1.40.0000.00817.47
8.1.30.0040.00817.58
8.1.20.0050.00317.60
8.1.10.0080.00017.51
8.1.00.0040.00417.41
8.0.300.0040.00420.15
8.0.290.0030.00616.75
8.0.280.0000.00718.47
8.0.270.0000.00718.07
8.0.260.0030.00318.38
8.0.250.0030.00317.06
8.0.240.0000.00716.95
8.0.230.0050.00316.93
8.0.220.0040.00416.95
8.0.210.0040.00416.94
8.0.200.0000.00617.05
8.0.190.0000.00716.93
8.0.180.0040.00416.95
8.0.170.0060.00316.96
8.0.160.0050.00316.99
8.0.150.0000.00716.84
8.0.140.0040.00416.93
8.0.130.0030.00313.36
8.0.120.0040.00416.96
8.0.110.0070.00016.91
8.0.100.0040.00416.76
8.0.90.0030.00516.92
8.0.80.0050.01016.90
8.0.70.0020.00616.81
8.0.60.0030.00516.90
8.0.50.0040.00416.88
8.0.30.0050.01017.02
8.0.20.0070.00817.22
8.0.10.0040.00416.99
8.0.00.0050.00716.87
7.4.330.0060.00216.24
7.4.320.0030.00316.60
7.4.300.0030.00316.62
7.4.290.0070.00016.59
7.4.280.0030.00616.36
7.4.270.0000.00716.51
7.4.260.0030.00313.29
7.4.250.0000.00716.61
7.4.240.0000.00716.63
7.4.230.0020.00516.50
7.4.220.0010.00616.52
7.4.210.0040.00916.56
7.4.200.0020.00516.56
7.4.190.0040.00416.43
7.4.180.0040.00416.75
7.4.160.0000.00716.35
7.4.150.0000.00816.34
7.4.140.0080.00016.46
7.4.130.0070.00716.49
7.4.120.0050.00816.37
7.4.110.0070.00816.39
7.4.100.0090.00316.61
7.4.90.0030.00916.56
7.4.80.0060.00617.89
7.4.70.0000.01216.56
7.4.60.0060.00916.53
7.4.50.0090.00916.27
7.4.40.0090.00716.32
7.4.30.0080.00916.49
7.4.20.0100.01016.36
7.4.10.0080.00916.35
7.4.00.0090.00816.45
7.3.330.0000.00716.23
7.3.320.0050.00213.19
7.3.310.0030.00416.00
7.3.300.0000.00716.21
7.3.290.0090.00416.16
7.3.280.0060.00316.20
7.3.270.0050.00216.18
7.3.260.0070.00516.10
7.3.250.0080.00016.04
7.3.240.0070.01116.26
7.3.230.0100.00416.20
7.3.220.0060.00316.12
7.3.210.0080.00616.15
7.3.200.0030.00916.06
7.3.190.0090.00616.11
7.3.180.0080.00816.10
7.3.170.0120.00516.13
7.3.160.0060.01116.11
7.3.150.0100.00816.22
7.3.140.0140.00516.14
7.3.130.0100.00816.10
7.3.120.0100.00716.06
7.3.110.0060.00916.12
7.3.100.0090.00816.08
7.3.90.0080.00916.16
7.3.80.0070.00816.09
7.3.70.0050.01216.16
7.3.60.0070.00716.17
7.3.50.0100.00616.12
7.3.40.0090.00816.13
7.3.30.0070.01016.18
7.3.20.0140.00716.15
7.3.10.0140.00716.08
7.3.00.0090.00716.17
7.2.340.0030.00516.15
7.2.330.0030.01016.18
7.2.320.0090.00416.29
7.2.310.0080.00916.27
7.2.300.0110.00416.23
7.2.290.0120.00616.30
7.2.280.0090.01016.32
7.2.270.0140.00516.15
7.2.260.0090.01016.20
7.2.250.0090.00916.12
7.2.240.0090.00816.21
7.2.230.0090.00916.31
7.2.220.0090.00616.18
7.2.210.0080.00816.17
7.2.200.0070.01116.20
7.2.190.0070.00916.28
7.2.180.0070.00816.33
7.2.170.0090.00816.24
7.2.160.0110.00616.37
7.2.150.0070.01016.32
7.2.140.0070.01216.31
7.2.130.0050.01116.35
7.2.120.0090.00916.36
7.2.110.0070.00916.27
7.2.100.0060.01116.35
7.2.90.0090.00816.28
7.2.80.0080.01116.27
7.2.70.0130.00816.24
7.2.60.0160.00716.36
7.2.50.0060.01116.23
7.2.40.0130.00816.31
7.2.30.0110.00616.32
7.2.20.0120.00516.29
7.2.10.0080.01016.37
7.2.00.0100.00616.28
7.1.330.0090.00015.28
7.1.320.0030.00615.32
7.1.310.0040.00415.20
7.1.300.0040.00415.35
7.1.290.0100.00315.33
7.1.280.0060.00315.28
7.1.270.0070.00015.30
7.1.260.0040.00415.27
7.1.250.0070.00715.20
7.1.240.0030.00515.03
7.1.230.0040.00415.28
7.1.220.0040.00415.12
7.1.210.0040.00415.31
7.1.200.0070.00015.23
7.1.190.0030.00315.29
7.1.180.0000.00715.09
7.1.170.0030.00515.21
7.1.160.0000.00915.18
7.1.150.0040.00415.20
7.1.140.0050.00315.20
7.1.130.0000.00715.21
7.1.120.0000.00715.06
7.1.110.0070.00015.02
7.1.100.0000.00715.20
7.1.90.0070.00015.16
7.1.80.0030.00315.13
7.1.70.0090.00315.07
7.1.60.0050.00315.13
7.1.50.0040.00415.16
7.1.40.0120.00415.29
7.1.30.0080.00015.25
7.1.20.0000.00715.09
7.1.10.0040.00415.11
7.1.00.0030.00315.11
7.0.330.0030.00314.99
7.0.320.0000.00714.93
7.0.310.0050.00314.86
7.0.300.0070.00015.00
7.0.290.0070.00014.93
7.0.280.0040.00414.82
7.0.270.0030.00514.84
7.0.260.0000.00714.89
7.0.250.0000.00614.98
7.0.240.0030.00315.14
7.0.230.0000.00615.09
7.0.220.0000.00715.05
7.0.210.0040.00315.01
7.0.200.0080.00014.88
7.0.190.0100.00015.07
7.0.180.0040.00415.03
7.0.170.0040.00415.12
7.0.160.0060.00014.94
7.0.150.0000.00715.00
7.0.140.0060.00014.91
7.0.130.0070.00015.13
7.0.120.0030.00315.18
7.0.110.0000.00714.89
7.0.100.0060.00014.88
7.0.90.0000.00614.85
7.0.80.0040.00414.98
7.0.70.0000.00714.83
7.0.60.0000.00714.91
7.0.50.0030.00314.70
7.0.40.0040.00415.02
7.0.30.0080.00015.06
7.0.20.0050.00314.96
7.0.10.0070.00015.01
7.0.00.0000.00714.93
5.6.400.0020.00515.66
5.6.390.0040.00415.77
5.6.380.0050.00315.75
5.6.370.0030.00315.52
5.6.360.0030.00315.49
5.6.350.0000.00715.61
5.6.340.0030.00315.50
5.6.330.0040.00415.46
5.6.320.0000.00715.75
5.6.310.0040.00415.64
5.6.300.0030.00515.36
5.6.290.0050.00215.52
5.6.280.0000.00815.59
5.6.270.0000.00815.48
5.6.260.0040.00415.48
5.6.250.0030.00515.60
5.6.240.0050.00215.50
5.6.230.0000.00815.49
5.6.220.0000.00615.81
5.6.210.0040.00415.64
5.6.200.0030.00315.67
5.6.190.0000.00715.64
5.6.180.0030.00315.62
5.6.170.0000.00615.59
5.6.160.0030.00315.84
5.6.150.0030.00315.60
5.6.140.0070.00015.62
5.6.130.0000.00715.64
5.6.120.0050.00315.83
5.6.110.0070.00015.48
5.6.100.0080.00015.53
5.6.90.0040.00415.45
5.6.80.0040.00415.63
5.6.70.0000.00715.46
5.6.60.0030.00315.58
5.6.50.0070.00015.64
5.6.40.0030.00315.48
5.6.30.0000.00715.64
5.6.20.0050.00215.51
5.6.10.0000.00715.42
5.6.00.0000.00715.53
5.5.380.0000.00915.54
5.5.370.0040.00415.65
5.5.360.0040.00415.52
5.5.350.0030.00315.54
5.5.340.0030.00315.24
5.5.330.0030.00315.32
5.5.320.0030.00315.47
5.5.310.0030.00315.56
5.5.300.0060.00315.34
5.5.290.0030.00615.46
5.5.280.0000.00815.53
5.5.270.0070.00015.48
5.5.260.0040.00415.52
5.5.250.0030.00315.59
5.5.240.0030.00515.61
5.5.230.0000.00715.65
5.5.220.0060.00015.63
5.5.210.0050.00215.67
5.5.200.0000.00715.28
5.5.190.0000.00715.43
5.5.180.0030.00315.38
5.5.170.0000.00715.37
5.5.160.0050.00315.38
5.5.150.0040.00415.28
5.5.140.0030.00515.20
5.5.130.0040.00415.32
5.5.120.0000.00815.25
5.5.110.0040.00415.17
5.5.100.0040.00415.48
5.5.90.0050.00215.62
5.5.80.0040.00415.48
5.5.70.0030.00515.57
5.5.60.0080.00015.60
5.5.50.0030.00315.47
5.5.40.0000.00615.54
5.5.30.0000.00715.49
5.5.20.0030.00515.50
5.5.10.0040.00415.47
5.5.00.0060.00315.27
5.4.450.0060.00012.58
5.4.440.0030.00312.27
5.4.430.0030.00312.42
5.4.420.0030.00312.39
5.4.410.0030.00312.41
5.4.400.0000.00512.33
5.4.390.0030.00312.33
5.4.380.0020.00212.33
5.4.370.0000.00512.34
5.4.360.0000.00512.40
5.4.350.0050.00012.33
5.4.340.0020.00212.46
5.4.330.0030.00312.43
5.4.320.0030.00312.50
5.4.310.0000.00612.52
5.4.300.0000.00612.49
5.4.290.0030.00312.43
5.4.280.0050.00012.49
5.4.270.0060.00012.22
5.4.260.0060.00012.43
5.4.250.0030.00312.20
5.4.240.0000.00612.37
5.4.230.0030.00312.21
5.4.220.0050.00012.16
5.4.210.0000.00512.07
5.4.200.0000.00612.14
5.4.190.0050.00012.32
5.4.180.0030.00312.24
5.4.170.0000.00512.02
5.4.160.0000.00512.16
5.4.150.0050.00012.28
5.4.140.0050.00012.34
5.4.130.0030.00312.41
5.4.120.0030.00312.34
5.4.110.0000.00512.27
5.4.100.0000.00512.55
5.4.90.0000.00612.31
5.4.80.0000.00612.46
5.4.70.0030.00312.55
5.4.60.0020.00212.54
5.4.50.0000.00612.43
5.4.40.0000.00612.19
5.4.30.0030.00312.39
5.4.20.0020.00212.26
5.4.10.0000.00512.25
5.4.00.0060.00012.44
5.3.290.0000.00912.84
5.3.280.0070.00412.61
5.3.270.0050.00512.79
5.3.260.0100.00012.61
5.3.250.0050.00512.80
5.3.240.0050.00512.74
5.3.230.0100.00012.53
5.3.220.0070.00312.55
5.3.210.0110.00012.78
5.3.200.0070.00412.56
5.3.190.0050.00512.87
5.3.180.0070.00312.79
5.3.170.0070.00312.79
5.3.160.0030.00612.71
5.3.150.0000.01112.74
5.3.140.0080.00212.84
5.3.130.0060.00612.84
5.3.120.0050.00512.80
5.3.110.0060.00612.86
5.3.100.0080.00312.93
5.3.90.0060.00313.01
5.3.80.0070.00313.01
5.3.70.0100.00012.79
5.3.60.0040.00412.83
5.3.50.0040.00712.59
5.3.40.0050.00512.99
5.3.30.0110.00012.77
5.3.20.0100.00012.79
5.3.10.0070.00412.42
5.3.00.0060.00312.55
5.2.170.0050.00311.97
5.2.160.0080.00011.66
5.2.150.0000.00911.96
5.2.140.0080.00011.85
5.2.130.0080.00011.80
5.2.120.0090.00011.89
5.2.110.0060.00311.89
5.2.100.0030.00611.75
5.2.90.0020.00711.75
5.2.80.0060.00311.95
5.2.70.0030.00611.81
5.2.60.0060.00311.67
5.2.50.0000.00811.58
5.2.40.0000.00911.76
5.2.30.0080.00011.83
5.2.20.0040.00411.38
5.2.10.0030.00611.41
5.2.00.0040.00411.33
5.1.60.0040.00410.87
5.1.50.0000.00810.87
5.1.40.0000.00710.94
5.1.30.0080.00011.00
5.1.20.0050.00310.87
5.1.10.0080.00010.98
5.1.00.0000.00710.87
5.0.50.0030.00310.87
5.0.40.0040.00410.87
5.0.30.0060.00010.87
5.0.20.0000.00610.87
5.0.10.0000.00610.87
5.0.00.0030.00310.87
4.4.90.0040.00010.87
4.4.80.0000.00510.87
4.4.70.0040.00010.87
4.4.60.0040.00010.87
4.4.50.0020.00210.87
4.4.40.0000.00510.87
4.4.30.0000.00410.87
4.4.20.0030.00210.87
4.4.10.0050.00010.87
4.4.00.0040.00010.87
4.3.110.0020.00210.87
4.3.100.0000.00410.87
4.3.90.0000.00510.87
4.3.80.0000.00510.87
4.3.70.0000.00410.87
4.3.60.0050.00010.87
4.3.50.0000.00510.87
4.3.40.0000.00410.87
4.3.30.0040.00010.87
4.3.20.0000.00410.87
4.3.10.0000.00410.87
4.3.00.0000.00410.87

preferences:
34.64 ms | 401 KiB | 5 Q