3v4l.org

run code in 300+ PHP versions simultaneously
<?php class planDTO { public $plans; public function __construct($plans) { $this->plans = $plans; } public function checkValue($planId) { foreach ($this->plans as $k => $plan) { if ($plan['eventId'] == $planId) { $this->plans = $plan; return $this; } } } } $arrPlanDTO = [0 => ["eventId" => 1, "planId" => 1, "name" => "student only"], 1 => ["eventId" => 2, "planId" => 2, "name" => "employee only"], 2 => ["eventId" => 3, "planId" => 3, "name" => "individual only"]]; $objPlan = new planDTO($arrPlanDTO); $v = $objPlan->checkValue(2); print_r($v);

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.0130.00716.50
8.3.50.0090.00618.23
8.3.40.0090.00619.17
8.3.30.0090.00618.72
8.3.20.0050.00324.18
8.3.10.0050.00324.66
8.3.00.0000.00826.16
8.2.180.0100.01025.92
8.2.170.0070.00722.96
8.2.160.0130.00022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00326.35
8.2.110.0030.00717.63
8.2.100.0080.00417.91
8.2.90.0050.00317.75
8.2.80.0040.00418.90
8.2.70.0080.00017.50
8.2.60.0000.00817.50
8.2.50.0090.00018.05
8.2.40.0040.00419.88
8.2.30.0070.00018.08
8.2.20.0070.00018.04
8.2.10.0070.00019.36
8.2.00.0030.00519.42
8.1.280.0130.00325.92
8.1.270.0040.00423.99
8.1.260.0060.00328.09
8.1.250.0040.00428.09
8.1.240.0030.00623.92
8.1.230.0060.00620.97
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0040.00417.52
8.1.190.0080.00017.25
8.1.180.0040.00418.10
8.1.170.0040.00418.98
8.1.160.0080.00018.83
8.1.150.0000.00818.95
8.1.140.0000.00719.00
8.1.130.0000.00820.06
8.1.120.0080.00017.40
8.1.110.0070.00017.46
8.1.100.0000.00717.36
8.1.90.0070.00017.38
8.1.80.0040.00417.50
8.1.70.0000.00717.50
8.1.60.0060.00317.53
8.1.50.0000.00817.54
8.1.40.0000.00817.43
8.1.30.0030.00517.66
8.1.20.0030.00617.61
8.1.10.0030.00617.43
8.1.00.0080.00317.47
8.0.300.0040.00418.77
8.0.290.0030.00616.63
8.0.280.0000.00718.36
8.0.270.0000.00817.93
8.0.260.0000.00618.44
8.0.250.0030.00316.95
8.0.240.0060.00016.98
8.0.230.0000.00716.93
8.0.220.0000.00716.76
8.0.210.0000.00616.89
8.0.200.0040.00416.98
8.0.190.0000.00716.93
8.0.180.0040.00416.88
8.0.170.0030.00516.96
8.0.160.0050.00316.78
8.0.150.0040.00416.84
8.0.140.0050.00316.88
8.0.130.0060.00013.34
8.0.120.0000.00716.80
8.0.110.0090.00016.82
8.0.100.0080.00016.72
8.0.90.0000.00916.78
8.0.80.0060.00816.82
8.0.70.0040.00416.84
8.0.60.0030.00516.77
8.0.50.0050.00216.98
8.0.30.0110.00716.80
8.0.20.0170.00317.18
8.0.10.0070.00016.99
8.0.00.0140.01116.52
7.4.330.0000.00415.55
7.4.320.0040.00416.47
7.4.300.0070.00016.42
7.4.290.0030.00316.59
7.4.280.0050.00316.59
7.4.270.0030.00316.41
7.4.260.0000.00513.30
7.4.250.0040.00416.52
7.4.240.0050.00216.58
7.4.230.0000.00916.71
7.4.220.0050.00316.55
7.4.210.0040.01016.57
7.4.200.0070.00016.32
7.4.130.0140.00416.47
7.4.120.0130.00616.65
7.4.110.0000.01716.31
7.4.100.0030.01716.54
7.4.90.0000.02116.38
7.4.80.0070.01119.39
7.4.70.0060.01016.52
7.4.60.0100.00616.45
7.4.50.0110.00616.29
7.4.40.0030.01316.49
7.4.30.0090.00816.45
7.4.20.0100.00716.49
7.4.10.0120.00616.36
7.4.00.0140.00316.25
7.3.330.0030.00316.38
7.3.320.0050.00013.30
7.3.310.0040.00416.13
7.3.300.0000.00716.36
7.3.290.0080.01016.29
7.3.260.0130.00316.61
7.3.240.0080.00916.57
7.3.230.0170.00016.45
7.3.210.0120.00616.40
7.3.200.0130.00316.59
7.3.190.0140.00416.49
7.3.180.0080.00816.49
7.3.170.0030.01216.41
7.3.160.0060.01216.29
7.3.150.0090.00816.63
7.3.140.0080.00816.43
7.3.130.0030.01216.28
7.3.120.0080.00816.35
7.3.110.0030.01216.22
7.3.100.0120.00316.48
7.3.90.0140.00316.24
7.3.80.0070.01016.27
7.3.70.0170.00316.13
7.3.60.0130.00416.31
7.3.50.0070.01116.36
7.3.40.0030.01316.43
7.3.30.0180.00016.23
7.3.20.0130.00616.24
7.3.10.0070.01516.47
7.3.00.0120.00916.44
7.2.330.0130.00616.61
7.2.320.0140.00316.48
7.2.310.0130.00316.62
7.2.300.0110.00516.74
7.2.290.0030.01416.43
7.2.280.0070.01116.53
7.2.270.0150.00316.64
7.2.260.0050.01116.47
7.2.250.0070.01016.53
7.2.240.0050.01016.68
7.2.230.0140.00316.37
7.2.220.0110.00716.57
7.2.210.0140.00316.61
7.2.200.0120.00616.56
7.2.190.0040.01316.58
7.2.180.0100.00716.52
7.2.170.0090.01216.61
7.2.160.0140.00616.62
7.2.150.0140.00516.70
7.2.140.0140.00916.78
7.2.130.0150.00316.58
7.2.120.0110.00716.63
7.2.110.0060.01216.79
7.2.100.0130.00516.75
7.2.90.0130.00616.66
7.2.80.0220.00318.43
7.2.70.0110.00618.48
7.2.60.0110.00618.52
7.2.50.0030.01418.45
7.2.40.0140.00418.53
7.2.30.0100.01018.40
7.2.20.0070.01018.37
7.2.10.0070.01018.47
7.2.00.0100.00618.36

preferences:
36 ms | 400 KiB | 5 Q