3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Apm { public $duration; function __construct($duration) { $this->duration = $duration; } } $apps = [ "09:00" => new Apm(45), "09:15" => "", // I want to delete this row -> 15 minutes "09:30" => "", // I want to delete this row -> 30 minutes end of the appointment "09:45" => "", "10:00" => new Apm(60), "10:15" => "", // I want to delete this row -> 15 minutes "10:30" => "", // I want to delete this row -> 30 minutes "10:45" => "", // I want to delete this row -> 45 minutes "11:00" => "", // I want to delete this row -> 60 minutes end of the appointment "11:15" => "", "11:30" => "", "11:45" => new Apm(90), ]; $duration = 0; $filtered = array_filter( $apps, function ($apm) use (&$duration) { if ($duration === 0) { if (!empty($apm->duration)) { $duration = $apm->duration - 15; return true; } else { return true; } } else { $duration -= 15; return false; } } ); print_r($filtered);

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.5.10.0040.00321.38
8.5.00.0130.00920.05
8.4.150.0020.00114.05
8.4.140.0140.00717.60
8.4.130.0110.00919.02
8.4.120.0020.00624.18
8.4.110.0060.00518.90
8.4.100.0110.00918.79
8.4.90.0160.00418.71
8.4.80.0070.01317.96
8.4.70.0090.01217.88
8.4.60.0110.00719.00
8.4.50.0090.01218.85
8.4.40.0120.00017.71
8.4.30.0100.01020.35
8.4.20.0000.01920.69
8.4.10.0030.00619.58
8.3.280.0080.01218.56
8.3.270.0080.01116.47
8.3.260.0090.01116.68
8.3.250.0090.01218.90
8.3.240.0100.01119.18
8.3.230.0110.00816.65
8.3.220.0110.00717.31
8.3.210.0060.00316.45
8.3.200.0060.00316.61
8.3.190.0120.00716.45
8.3.180.0030.00616.54
8.3.170.0120.00618.77
8.3.160.0130.00718.54
8.3.150.0120.00620.71
8.3.140.0040.00416.68
8.3.130.0040.00416.70
8.3.120.0090.00920.61
8.3.110.0090.00916.75
8.3.100.0150.00318.30
8.3.90.0080.00026.77
8.3.80.0060.00316.76
8.3.70.0120.00316.63
8.3.60.0000.01518.43
8.3.50.0090.00518.57
8.3.40.0100.00618.79
8.3.30.0070.00718.88
8.3.20.0050.00521.03
8.3.10.0040.00423.40
8.3.00.0040.00420.76
8.2.290.0100.00920.32
8.2.280.0090.01016.76
8.2.270.0110.00717.18
8.2.260.0000.00817.41
8.2.250.0080.00018.39
8.2.240.0060.00318.34
8.2.230.0090.00020.94
8.2.220.0190.00024.06
8.2.210.0090.00026.77
8.2.200.0030.00616.88
8.2.190.0150.00716.58
8.2.180.0130.01018.17
8.2.170.0060.00922.96
8.2.160.0030.01421.14
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00726.16
8.2.110.0040.00422.02
8.2.100.0040.00817.78
8.2.90.0090.00017.96
8.2.80.0000.00918.03
8.2.70.0050.00318.05
8.2.60.0000.00818.28
8.2.50.0040.00418.10
8.2.40.0040.00421.11
8.2.30.0000.00719.39
8.2.20.0040.00418.11
8.2.10.0040.00418.97
8.2.00.0040.00419.38
8.1.330.0090.00221.74
8.1.320.0140.00616.44
8.1.310.0070.00316.95
8.1.300.0060.00316.05
8.1.290.0070.00330.84
8.1.280.0090.00625.92
8.1.270.0000.00822.20
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0000.00820.43
8.1.230.0070.00420.88
8.1.220.0040.00420.91
8.1.210.0060.00318.79
8.1.200.0060.00317.35
8.1.190.0060.00617.38
8.1.180.0000.00818.10
8.1.170.0040.00418.78
8.1.160.0060.00320.71
8.1.150.0030.00518.84
8.1.140.0070.00018.90
8.1.130.0050.00319.22
8.1.120.0070.00017.52
8.1.110.0040.00417.52
8.1.100.0040.00417.39
8.1.90.0000.00717.39
8.1.80.0060.00317.54
8.1.70.0070.00017.50
8.1.60.0040.00817.64
8.1.50.0000.00917.63
8.1.40.0000.00817.59
8.1.30.0000.01217.59
8.1.20.0000.00917.75
8.1.10.0040.00417.61
8.1.00.0000.00817.41
8.0.300.0040.00421.96
8.0.290.0070.00016.63
8.0.280.0000.00818.40
8.0.270.0030.00316.79
8.0.260.0070.00016.86
8.0.250.0050.00316.98
8.0.240.0040.00417.05
8.0.230.0000.00616.98
8.0.220.0020.00516.82
8.0.210.0070.00016.85
8.0.200.0070.00017.05
8.0.190.0030.00317.02
8.0.180.0000.00816.93
8.0.170.0000.00916.93
8.0.160.0000.00716.86
8.0.150.0040.00416.84
8.0.140.0030.00616.79
8.0.130.0000.00613.38
8.0.120.0080.00016.80
8.0.110.0050.00316.91
8.0.100.0030.00517.02
8.0.90.0090.00016.91
8.0.80.0060.01016.96
8.0.70.0000.00716.80
8.0.60.0050.00316.99
8.0.50.0000.00716.96
8.0.30.0120.00616.88
8.0.20.0110.00716.91
8.0.10.0040.00416.92
8.0.00.0090.01216.68
7.4.330.0000.00615.55
7.4.320.0030.00316.52
7.4.300.0060.00016.53
7.4.290.0000.00716.63
7.4.280.0060.00316.53
7.4.270.0070.00016.41
7.4.260.0000.00513.31
7.4.250.0040.00416.64
7.4.240.0050.00216.56
7.4.230.0000.00716.52
7.4.220.0020.00516.43
7.4.210.0110.00316.73
7.4.200.0070.00016.68
7.4.130.0210.02416.63
7.4.120.0140.00716.70
7.4.110.0130.00616.36
7.4.100.0100.00916.55
7.4.90.0080.01216.68
7.4.80.0100.00619.39
7.4.70.0120.00316.67
7.4.60.0090.00716.62
7.4.50.0140.00316.50
7.4.40.0130.00316.67
7.4.00.0030.01414.82
7.3.330.0030.00516.28
7.3.320.0000.00513.18
7.3.310.0040.00416.45
7.3.300.0060.00016.23
7.3.290.0070.00616.35
7.3.280.0000.01516.44
7.3.260.0100.00816.41
7.3.240.0100.01016.40
7.3.230.0140.00516.38
7.3.210.0070.01016.70
7.3.200.0060.01216.45
7.3.190.0080.01116.39
7.3.180.0110.01516.34
7.3.170.0130.00316.44
7.3.160.0080.00816.42
7.3.110.0100.00414.95
7.3.100.0030.01514.86
7.3.90.0040.01515.12
7.3.80.0110.00514.77
7.3.70.0060.00714.78
7.3.60.0080.01214.79
7.3.50.0080.01114.57
7.3.40.0060.01214.65
7.3.30.0090.00314.87
7.3.20.0070.00714.76
7.3.10.0070.00714.84
7.3.00.0100.00314.93
7.2.330.0070.01116.54
7.2.320.0100.00616.80
7.2.310.0100.00616.77
7.2.300.0090.00816.61
7.2.290.0030.01316.84
7.2.240.0040.01115.03
7.2.230.0110.00815.17
7.2.220.0100.01015.16
7.2.210.0120.00814.93
7.2.200.0110.00815.13
7.2.190.0140.00615.09
7.2.180.0060.01214.83
7.2.170.0100.00315.04
7.2.160.0070.00715.10
7.2.150.0070.00715.09
7.2.140.0040.01115.18
7.2.130.0030.01015.14
7.2.120.0060.00915.07
7.2.110.0070.00715.09
7.2.100.0120.00315.19
7.2.90.0050.01015.10
7.2.80.0100.01015.15
7.2.70.0100.01014.98
7.2.60.0120.00814.93
7.2.50.0030.01715.00
7.2.40.0150.00614.93
7.2.30.0080.01214.87
7.2.20.0070.01415.14
7.2.10.0120.00915.14
7.2.00.0170.00015.16
7.1.330.0040.00914.05
7.1.320.0060.00914.04
7.1.310.0070.00714.13
7.1.300.0110.00813.76
7.1.290.0090.00914.00
7.1.280.0060.00613.77
7.1.270.0060.00613.73
7.1.260.0030.00913.88
7.1.250.0000.01213.93

preferences:
37.94 ms | 403 KiB | 5 Q