3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ListenerAggregate {} class EM { public function attach(callable $listener) { if($listener instanceof ListenerAggregate){ echo "Attached an aggregate\n"; }else{ echo "Attached regular callable\n"; } } } class SomeAggregateListener implements ListenerAggregate { public function __invoke() { // look ma, I'm a callable! } } $em = new EM; $em->attach(function(){}); $aggregate = new SomeAggregateListener; $em->attach($aggregate);

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.83
8.3.30.0080.00619.22
8.3.20.0050.00220.24
8.3.10.0040.00423.48
8.3.00.0080.00020.94
8.2.170.0110.00422.96
8.2.160.0070.00720.14
8.2.150.0040.00424.18
8.2.140.0070.01124.66
8.2.130.0040.00426.16
8.2.120.0080.00020.94
8.2.110.0040.00421.11
8.2.100.0060.00617.91
8.2.90.0040.00417.91
8.2.80.0040.00417.97
8.2.70.0030.00617.37
8.2.60.0040.00417.91
8.2.50.0030.00518.07
8.2.40.0060.00319.88
8.2.30.0000.00718.32
8.2.20.0000.00717.61
8.2.10.0060.00317.99
8.2.00.0040.00417.74
8.1.270.0030.00523.90
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.52
8.1.230.0080.00320.88
8.1.220.0030.00517.74
8.1.210.0050.00319.04
8.1.200.0060.00617.23
8.1.190.0050.00317.13
8.1.180.0060.00318.10
8.1.170.0080.00018.65
8.1.160.0040.00422.05
8.1.150.0000.00718.73
8.1.140.0040.00417.44
8.1.130.0060.00017.95
8.1.120.0000.00717.43
8.1.110.0020.00517.35
8.1.100.0070.00017.36
8.1.90.0000.00717.42
8.1.80.0000.00817.31
8.1.70.0030.00317.36
8.1.60.0040.00417.48
8.1.50.0030.00617.42
8.1.40.0000.00817.54
8.1.30.0050.00317.55
8.1.20.0030.00517.64
8.1.10.0080.00017.55
8.1.00.0080.00017.37
8.0.300.0000.00720.03
8.0.290.0070.00016.75
8.0.280.0000.00718.43
8.0.270.0000.00716.88
8.0.260.0000.00617.27
8.0.250.0000.00717.04
8.0.240.0080.00316.99
8.0.230.0080.00016.99
8.0.220.0070.00016.95
8.0.210.0070.00016.94
8.0.200.0100.00017.00
8.0.190.0050.00317.04
8.0.180.0040.00417.03
8.0.170.0030.00516.87
8.0.160.0000.00717.07
8.0.150.0040.00416.80
8.0.140.0030.00516.91
8.0.130.0070.00013.38
8.0.120.0000.00816.89
8.0.110.0000.00816.82
8.0.100.0000.00816.99
8.0.90.0070.00017.07
8.0.80.0060.01516.95
8.0.70.0040.00416.95
8.0.60.0070.00016.89
8.0.50.0050.00316.85
8.0.30.0120.00617.00
8.0.20.0100.01217.40
8.0.10.0070.00017.05
8.0.00.0110.00817.01
7.4.330.0000.00615.04
7.4.320.0080.00016.50
7.4.300.0030.00316.65
7.4.290.0030.00316.64
7.4.280.0040.00416.52
7.4.270.0040.00416.53
7.4.260.0040.00416.49
7.4.250.0050.00216.46
7.4.240.0040.00316.50
7.4.230.0030.00316.48
7.4.220.0070.01116.57
7.4.210.0080.00616.64
7.4.200.0070.00016.50
7.4.160.0100.00616.59
7.4.150.0110.00617.40
7.4.140.0070.01217.86
7.4.130.0140.00616.41
7.4.120.0100.00716.54
7.4.110.0030.01716.44
7.4.100.0050.01116.35
7.4.90.0090.01216.61
7.4.80.0130.00719.39
7.4.70.0050.01116.34
7.4.60.0090.00916.70
7.4.50.0030.00616.32
7.4.40.0000.01716.46
7.4.30.0090.00616.43
7.4.00.0080.00714.69
7.3.330.0030.00313.31
7.3.320.0030.00313.38
7.3.310.0030.00316.42
7.3.300.0000.00716.36
7.3.290.0130.00316.41
7.3.280.0080.01016.38
7.3.270.0120.00617.40
7.3.260.0110.00616.62
7.3.250.0050.01616.31
7.3.240.0080.00816.53
7.3.230.0070.01416.39
7.3.210.0040.01516.29
7.3.200.0120.00319.39
7.3.190.0090.01216.18
7.3.180.0090.00616.41
7.3.170.0100.00716.65
7.3.160.0040.01216.64
7.3.120.0060.01114.96
7.3.110.0080.00814.90
7.3.100.0060.00814.57
7.3.90.0030.01314.86
7.3.80.0000.01214.63
7.3.70.0130.00014.69
7.3.60.0030.01014.87
7.3.50.0120.00614.82
7.3.40.0030.01314.87
7.3.30.0090.00614.95
7.3.20.0060.00616.74
7.3.10.0090.00616.55
7.3.00.0090.00616.74
7.2.330.0070.01116.68
7.2.320.0150.00916.75
7.2.310.0080.00816.77
7.2.300.0090.00916.68
7.2.290.0110.01116.81
7.2.250.0160.00315.02
7.2.240.0040.01514.86
7.2.230.0080.00815.14
7.2.220.0060.01015.14
7.2.210.0080.00414.68
7.2.200.0060.00915.11
7.2.190.0000.01715.04
7.2.180.0060.00915.07
7.2.170.0060.00614.90
7.2.60.0160.00316.68
7.2.50.0130.00716.80
7.1.330.0030.01315.75
7.1.320.0070.00715.88
7.1.310.0120.00415.74
7.1.300.0040.01215.84
7.1.290.0090.00316.00
7.1.280.0060.00815.54
7.1.270.0030.00615.61
7.1.260.0070.00715.80
7.1.200.0060.00815.67
7.1.100.0000.01718.12
7.1.70.0060.01017.03
7.1.60.0070.01719.70
7.1.50.0070.01816.91
7.1.00.0030.07322.48
7.0.200.0050.00316.86
7.0.140.0030.07022.12
7.0.60.0100.06719.74
7.0.50.0070.03717.86
7.0.40.0130.07720.20
7.0.30.0170.05020.20
7.0.20.0300.07320.07
7.0.10.0130.05020.23
7.0.00.0030.05320.33
5.6.280.0030.07320.91
5.6.210.0070.05020.66
5.6.200.0070.08718.16
5.6.190.0070.07020.46
5.6.180.0230.08720.67
5.6.170.0230.06720.43
5.6.160.0200.03720.49
5.6.150.0030.07018.18
5.6.140.0070.05018.29
5.6.130.0070.08018.21
5.6.120.0000.05021.03
5.6.110.0100.06321.02
5.6.100.0030.04320.99
5.6.90.0100.04021.14
5.6.80.0130.06720.42
5.6.70.3270.03720.37
5.5.350.0130.08020.42
5.5.340.0100.03017.93
5.5.330.0100.08720.44
5.5.320.0230.08720.38
5.5.310.0170.04720.32
5.5.300.0030.04317.94
5.5.290.0030.04018.04
5.5.280.0070.08020.80
5.5.270.0100.06720.98
5.5.260.0030.06720.88
5.5.250.0130.07320.60
5.5.240.0170.07020.20
5.4.450.0330.05019.32
5.4.440.0270.04019.41
5.4.430.0270.03719.47
5.4.420.0200.04019.56
5.4.410.0230.03719.19
5.4.400.0200.04019.23
5.4.390.0370.03719.05
5.4.380.0230.03719.23
5.4.370.0200.04019.15
5.4.360.0230.03719.15
5.4.350.0170.04018.98
5.4.340.0200.04319.15
5.4.320.0230.04019.31
5.4.310.0200.03719.08
5.4.300.0200.04019.06
5.4.290.0230.04018.87
5.4.280.0270.06318.91
5.4.270.0400.05319.14
5.4.260.0400.06019.31
5.4.250.0300.05019.31
5.4.240.0330.07018.84
5.4.230.0330.04719.21
5.4.220.0330.06018.86
5.4.210.0300.05019.21
5.4.200.0300.07019.07
5.4.190.0270.05019.12
5.4.180.0270.06719.08
5.4.170.0330.07318.96
5.4.160.0330.06719.18
5.4.150.0270.04019.02
5.4.140.0330.06316.41
5.4.130.0330.06716.38
5.4.120.0400.06016.38
5.4.110.0230.04016.61
5.4.100.0300.06716.58
5.4.90.0300.03716.50
5.4.80.0330.03716.59
5.4.70.0300.06316.55
5.4.60.0370.04316.54
5.4.50.0270.05316.38
5.4.40.0370.03316.40
5.4.30.0300.07016.57
5.4.20.0330.03316.42
5.4.10.0370.06716.34
5.4.00.0370.04715.94
5.3.290.0270.03714.78
5.3.280.0300.03014.60
5.3.270.0270.05714.53
5.3.260.0270.05314.61
5.3.250.0330.07014.69
5.3.240.0300.04714.65
5.3.230.0300.06314.52
5.3.220.0270.04314.57
5.3.210.0300.03714.48
5.3.200.0300.04714.56
5.3.190.0370.05314.49
5.3.180.0230.04314.79
5.3.170.0300.07314.62
5.3.160.0300.06314.48
5.3.150.0370.06014.48
5.3.140.0330.04014.48
5.3.130.0330.04314.52
5.3.120.0430.05714.55
5.3.110.0300.07014.63
5.3.100.0330.04314.20
5.3.90.0400.06314.07
5.3.80.0470.06013.95
5.3.70.0330.06314.00
5.3.60.0370.04313.98
5.3.50.0430.06014.01
5.3.40.0370.07013.87
5.3.30.0300.05714.01
5.3.20.0400.05713.67
5.3.10.0430.05313.74
5.3.00.0400.04713.86
5.2.170.0330.05311.06
5.2.160.0330.05711.20
5.2.150.0330.05711.24
5.2.140.0330.04711.06
5.2.130.0300.05011.16
5.2.120.0230.03711.02
5.2.110.0270.03711.11
5.2.100.0300.05011.04
5.2.90.0300.05311.03
5.2.80.0230.05711.12
5.2.70.0230.03711.26
5.2.60.0200.03010.96
5.2.50.0270.03011.14
5.2.40.0200.03310.90
5.2.30.0230.02310.88
5.2.20.0200.02710.89
5.2.10.0200.02710.75
5.2.00.0170.03310.65
5.1.60.0270.02310.65
5.1.50.0170.02710.65
5.1.40.0300.02310.65
5.1.30.0270.02310.65
5.1.20.0230.02010.65
5.1.10.0200.03710.65
5.1.00.0270.03710.65
5.0.50.0170.03310.65
5.0.40.0130.04310.65
5.0.30.0200.05310.65
5.0.20.0170.04010.65
5.0.10.0100.02310.65
5.0.00.0200.05710.65
4.4.90.0070.01710.65
4.4.80.0070.02010.65
4.4.70.0070.02010.65
4.4.60.0100.01710.65
4.4.50.0130.01310.65
4.4.40.0100.03710.65
4.4.30.0170.02010.65
4.4.20.0130.03010.65
4.4.10.0130.02010.65
4.4.00.0100.04710.65
4.3.110.0130.03310.65
4.3.100.0130.03310.65
4.3.90.0070.02010.65
4.3.80.0070.04310.65
4.3.70.0130.02010.65
4.3.60.0170.01710.65
4.3.50.0170.03010.65
4.3.40.0100.03010.65
4.3.30.0070.02010.65
4.3.20.0100.03310.65
4.3.10.0130.03010.65
4.3.00.0100.01710.65

preferences:
41.44 ms | 400 KiB | 5 Q