3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Notification { public $is_notifyable; public $children = []; } function mergeNotifications(Notification ... $notifications) : array { $result = []; foreach ($notifications as $notification) { // Can no longer be "empty" // if (empty($notification)) continue; // is_notifyable is now a promise that your interface made: if ($notification->is_notifyable) { $result[] = $notification; } else { // flatten the notifications recursively: foreach(mergeNotifications(...$notification->children) as $child) { $result[] = $child; } } } return $result; } $arr = [ new Notification(), new Notification(), ]; var_dump(mergeNotifications(...$arr));

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.0100.00718.58
8.3.50.0100.01018.20
8.3.40.0060.01018.55
8.3.30.0150.00018.59
8.3.20.0000.00719.07
8.3.10.0070.00021.09
8.3.00.0070.00023.65
8.2.180.0080.00816.63
8.2.170.0100.01022.96
8.2.160.0070.00720.57
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.40
8.2.110.0060.00321.13
8.2.100.0080.00417.91
8.2.90.0000.00818.03
8.2.80.0050.00319.17
8.2.70.0040.00417.50
8.2.60.0040.00417.63
8.2.50.0050.00317.63
8.2.40.0000.00819.27
8.2.30.0030.00319.51
8.2.20.0050.00318.03
8.2.10.0000.01018.17
8.2.00.0050.00319.42
8.1.280.0000.02225.92
8.1.270.0100.00020.52
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0080.00022.14
8.1.230.0110.00020.91
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0000.01017.48
8.1.190.0050.00517.23
8.1.180.0060.00318.10
8.1.170.0000.00917.62
8.1.160.0040.00418.89
8.1.150.0000.00718.90
8.1.140.0030.00617.70
8.1.130.0000.00919.12
8.1.120.0020.00517.36
8.1.110.0000.00817.51
8.1.100.0040.00417.43
8.1.90.0070.00317.47
8.1.80.0040.00417.46
8.1.70.0070.00017.50
8.1.60.0040.00417.50
8.1.50.0080.00017.43
8.1.40.0030.00717.41
8.1.30.0080.00017.50
8.1.20.0000.00717.57
8.1.10.0030.00517.52
8.1.00.0080.00017.50
8.0.300.0070.00020.09
8.0.290.0000.00816.75
8.0.280.0000.00718.46
8.0.270.0070.00017.25
8.0.260.0030.00317.14
8.0.250.0070.00316.96
8.0.240.0070.00016.89
8.0.230.0000.00716.95
8.0.220.0030.00716.87
8.0.210.0070.00016.90
8.0.200.0030.00316.96
8.0.190.0000.00816.82
8.0.180.0040.00416.81
8.0.170.0090.00016.95
8.0.160.0000.00716.96
8.0.150.0040.00416.78
8.0.140.0030.00316.81
8.0.130.0030.00313.30
8.0.120.0060.00316.75
8.0.110.0000.00816.91
8.0.100.0080.00016.94
8.0.90.0070.00016.92
8.0.80.0040.01116.82
8.0.70.0020.00516.81
8.0.60.0000.00716.73
8.0.50.0070.00016.72
8.0.30.0100.01017.07
8.0.20.0100.01017.40
8.0.10.0040.00417.03
8.0.00.0120.00916.73
7.4.330.0020.00215.55
7.4.320.0000.00616.58
7.4.300.0060.00016.48
7.4.290.0000.00716.58
7.4.280.0080.00016.44
7.4.270.0050.00316.50
7.4.260.0000.00716.48
7.4.250.0050.00216.54
7.4.240.0030.00316.51
7.4.230.0000.00816.60
7.4.220.0040.00416.31
7.4.210.0060.01116.51
7.4.200.0000.00716.39
7.4.160.0090.00916.40
7.4.140.0110.00817.86
7.4.130.0140.00316.57
7.4.120.0090.01016.53
7.4.110.0170.00316.59
7.4.100.0080.00816.37
7.4.90.0100.00716.54
7.4.80.0150.00319.39
7.4.70.0070.01116.55
7.4.60.0120.00516.41
7.4.50.0060.01016.40
7.4.40.0100.01016.55
7.4.00.0030.01514.85
7.3.330.0030.00313.04
7.3.320.0070.00013.31
7.3.310.0050.00216.33
7.3.300.0060.00016.35
7.3.290.0060.00316.31
7.3.280.0040.00816.30
7.3.260.0110.00916.30
7.3.240.0110.00616.44
7.3.230.0080.00816.66
7.3.210.0090.00916.34
7.3.200.0080.00716.38
7.3.190.0120.00616.42
7.3.180.0130.00316.68
7.3.170.0110.00716.37
7.3.160.0100.00716.59
7.2.330.0140.00316.64
7.2.320.0090.00916.56
7.2.310.0060.01216.80
7.2.300.0120.00616.64
7.2.290.0060.01916.88
7.2.60.0160.00314.84
7.2.50.0130.00714.85
7.2.40.0130.01015.18
7.2.30.0100.01014.76
7.2.20.0070.01415.14
7.2.10.0100.01014.93
7.2.00.0160.01314.92
7.1.200.0000.01215.68
7.1.170.0120.00913.94
7.1.160.0150.00713.91
7.1.150.0170.00313.88
7.1.140.0160.00314.00
7.1.130.0160.00313.75
7.1.120.0180.00613.60
7.1.110.0100.01014.02
7.1.100.0120.00613.83
7.1.90.0090.00913.69
7.1.80.0140.00313.91
7.1.70.0090.00914.06
7.1.60.0220.01631.79
7.1.50.0260.01332.04
7.1.40.0310.00731.98
7.1.30.1130.01332.06
7.1.20.0220.01632.05
7.1.10.0060.01313.69
7.1.00.0240.00914.02

preferences:
61.98 ms | 400 KiB | 5 Q