3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NameObj { public $name; function __construct($name){ $this->name = $name; } } class IdObj{ public $id; function __construct($id){ $this->id = $id; } } $idArray = array( new IdObj(1), new IdObj(2), new IdObj(3) ); $nameArray = array( new NameObj('1 - Object 1 Name'), new NameObj('2 - Object 2 Name') ); function custom_diff($oId, $oName){ $temp = $oId; $oId = $oId instanceof IdObj?$oId:$oName; $oName = $oName instanceof NameObj?$oName:$temp; $splitName = explode(' - ', $oName->name); $idFromName = $splitName[0]; $id = $oId->id; if($idFromName == $id) return 0; return $idFromName > $id ? 1 : -1; } $missing_objects = array_udiff($idArray, $nameArray, 'custom_diff'); print_r($missing_objects);

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.0120.00318.43
8.3.50.0080.00921.97
8.3.40.0100.01018.84
8.3.30.0040.01119.21
8.3.20.0000.00820.15
8.3.10.0050.00322.09
8.3.00.0050.00222.39
8.2.180.0110.00718.29
8.2.170.0110.00422.96
8.2.160.0100.00320.19
8.2.150.0000.00824.18
8.2.140.0090.00624.66
8.2.130.0070.00026.16
8.2.120.0090.00019.38
8.2.110.0060.00321.02
8.2.100.0060.00617.71
8.2.90.0050.00319.21
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0070.00318.28
8.2.30.0070.00018.02
8.2.20.0040.00417.79
8.2.10.0030.00517.77
8.2.00.0040.00417.72
8.1.280.0070.00725.92
8.1.270.0000.00822.24
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00621.31
8.1.230.0040.00817.52
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0000.00917.35
8.1.180.0000.00818.10
8.1.170.0030.00518.46
8.1.160.0070.00021.99
8.1.150.0000.00718.57
8.1.140.0000.00717.46
8.1.130.0070.00017.80
8.1.120.0040.00417.41
8.1.110.0050.00317.48
8.1.100.0040.00417.37
8.1.90.0000.00717.44
8.1.80.0070.00017.48
8.1.70.0030.00317.46
8.1.60.0080.00017.49
8.1.50.0000.00817.54
8.1.40.0060.00317.42
8.1.30.0000.00817.64
8.1.20.0000.00817.60
8.1.10.0000.00817.61
8.1.00.0040.00417.53
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0040.00418.40
8.0.270.0000.00717.19
8.0.260.0030.00316.91
8.0.250.0000.00717.11
8.0.240.0040.00317.06
8.0.230.0030.00316.97
8.0.220.0050.00216.91
8.0.210.0000.00816.97
8.0.200.0050.00217.05
8.0.190.0000.00817.08
8.0.180.0040.00416.91
8.0.170.0000.00717.00
8.0.160.0000.00816.85
8.0.150.0000.00716.84
8.0.140.0040.00316.97
8.0.130.0030.00313.39
8.0.120.0040.00416.98
8.0.110.0040.00417.01
8.0.100.0070.00316.96
8.0.90.0030.00516.91
8.0.80.0030.01816.94
8.0.70.0050.00316.80
8.0.60.0000.00716.80
8.0.50.0040.00416.97
8.0.30.0080.01117.02
8.0.20.0070.01617.43
8.0.10.0040.00417.02
8.0.00.0140.00516.74
7.4.330.0050.00015.05
7.4.320.0000.00616.54
7.4.300.0000.00616.52
7.4.290.0000.00716.55
7.4.280.0030.00316.46
7.4.270.0000.00716.54
7.4.260.0040.00416.61
7.4.250.0040.00416.44
7.4.240.0000.00816.51
7.4.230.0030.00316.70
7.4.220.0070.01116.60
7.4.210.0080.00616.66
7.4.200.0030.00316.52
7.4.190.0050.00316.50
7.4.160.0070.01016.58
7.4.150.0100.00717.40
7.4.140.0060.01317.86
7.4.130.0090.00916.58
7.4.120.0110.00616.62
7.4.110.0080.00916.67
7.4.100.0170.00016.49
7.4.90.0140.00316.51
7.4.80.0000.01719.39
7.4.70.0130.01016.44
7.4.60.0120.00616.45
7.4.50.0040.00416.51
7.4.40.0030.00722.77
7.4.30.0170.00416.66
7.4.00.0070.01014.90
7.3.330.0000.00513.30
7.3.320.0000.00513.41
7.3.310.0070.00016.34
7.3.300.0070.00016.38
7.3.290.0070.01316.47
7.3.280.0080.00916.46
7.3.270.0170.00717.40
7.3.260.0110.00716.50
7.3.250.0120.00716.49
7.3.240.0130.00316.63
7.3.230.0060.01216.49
7.3.210.0090.01016.30
7.3.200.0130.01019.39
7.3.190.0030.01316.64
7.3.180.0080.00816.46
7.3.170.0090.00616.42
7.3.160.0090.00616.39
7.3.120.0060.00914.99
7.2.330.0060.01216.47
7.2.320.0100.01516.65
7.2.310.0100.00716.71
7.2.300.0100.01316.46
7.2.290.0100.00616.50
7.1.70.0000.00917.35
7.1.60.0120.01219.82
7.1.50.0100.01317.00
7.1.00.0000.07722.45
7.0.200.0120.00616.81
7.0.140.0000.07721.92
7.0.60.0070.08719.92
7.0.50.0000.06717.87
7.0.40.0170.08020.24
7.0.30.0300.07320.20
7.0.20.0230.07720.22
7.0.10.0300.07320.09
7.0.00.0030.08320.16
5.6.280.0070.07020.91
5.6.210.0000.04320.77
5.6.200.0030.04318.18
5.6.190.0070.08720.34
5.6.180.4170.04020.39
5.6.170.0270.06020.54
5.6.160.0100.08020.48
5.6.150.0070.03718.12
5.6.140.0130.07318.18
5.6.130.0030.04018.27
5.6.120.0100.07720.97
5.6.110.0030.09021.14
5.6.100.0070.08320.98
5.6.90.0100.08320.97
5.6.80.0000.04320.52
5.6.70.0200.03720.37
5.5.350.0030.05720.43
5.5.340.0030.07717.95
5.5.330.0070.08320.57
5.5.320.0230.05320.32
5.5.310.0300.05720.51
5.5.300.0030.04017.98
5.5.290.0130.04317.99
5.5.280.0030.07020.95
5.5.270.0000.07320.78
5.5.260.0030.06320.83
5.5.250.0030.07020.62
5.5.240.0030.03720.08
5.4.450.0770.05719.60
5.4.440.0770.05319.69
5.4.430.0170.06719.36
5.4.420.0070.06019.43
5.4.410.0070.05719.45
5.4.400.1000.00018.82
5.4.390.1100.00018.57
5.4.380.0270.05018.77
5.4.370.0230.04718.47
5.4.360.0230.04718.73
5.4.350.0200.05318.57
5.4.340.0230.04718.73
5.4.320.0080.03512.51
5.4.310.0040.04412.50
5.4.300.0040.04012.51
5.4.290.0040.04012.50
5.4.280.0090.04112.40
5.4.270.0170.06718.95
5.4.260.0170.05719.01
5.4.250.0130.05719.00
5.4.240.0130.06718.80
5.4.230.0070.05719.02
5.4.220.0100.06019.00
5.4.210.0130.06318.64
5.4.200.0100.05719.10
5.4.190.0200.06318.97
5.4.180.0130.07018.95
5.4.170.0130.05018.99
5.4.160.0070.07318.89
5.4.150.0100.07018.79
5.4.140.0100.05316.48
5.4.130.0070.06716.44
5.4.120.0100.05016.50
5.4.110.0170.05016.64
5.4.100.0100.04716.44
5.4.90.0170.06016.47
5.4.80.0130.04716.45
5.4.70.0030.08016.41
5.4.60.0130.06716.49
5.4.50.0030.05716.38
5.4.40.0170.06316.58
5.4.30.0130.04316.49
5.4.20.0030.05316.36
5.4.10.0170.06016.46
5.4.00.0070.05016.00
5.3.290.0080.04012.80
5.3.280.0070.05314.68
5.3.270.0200.05314.63
5.3.260.0270.06014.61
5.3.250.0170.06714.78
5.3.240.0130.06714.63
5.3.230.0100.05314.74
5.3.220.0070.05014.56
5.3.210.0270.04314.56
5.3.200.0130.05714.54
5.3.190.0100.05014.64
5.3.180.0200.05714.63
5.3.170.0070.06014.59
5.3.160.0130.06314.66
5.3.150.0100.05714.48
5.3.140.0130.05014.74
5.3.130.0030.05714.38
5.3.120.0170.05314.74
5.3.110.0130.05014.38
5.3.100.0100.05014.11
5.3.90.0070.05314.21
5.3.80.0170.04314.04
5.3.70.0130.07014.10
5.3.60.0130.06314.16
5.3.50.0070.04714.02
5.3.40.0000.05713.94
5.3.30.0030.07013.76
5.3.20.0170.05313.79
5.3.10.0230.05313.66
5.3.00.0100.04713.72
5.2.170.0130.04011.05
5.2.160.0000.05011.24
5.2.150.0100.05311.23
5.2.140.0070.05011.31
5.2.130.0130.03311.33
5.2.120.0070.04011.18
5.2.110.0070.04011.18
5.2.100.0170.03711.34
5.2.90.0130.05311.17
5.2.80.0100.04711.09
5.2.70.0100.04011.32
5.2.60.0130.05011.14
5.2.50.0030.04711.00
5.2.40.0100.04711.19
5.2.30.0030.06010.98
5.2.20.0070.04311.14
5.2.10.0100.03310.70
5.2.00.0030.04310.82
5.1.60.0030.0379.84
5.1.50.0030.0379.98
5.1.40.0100.0339.99
5.1.30.0170.03710.42
5.1.20.0100.03010.44
5.1.10.0100.03310.05
5.1.00.0070.04310.13
5.0.50.0030.0378.47
5.0.40.0100.0338.57
5.0.30.0070.0438.43
5.0.20.0000.0308.19
5.0.10.0000.0408.10
5.0.00.0030.0408.22
4.4.90.0030.0206.64
4.4.80.0000.0306.64
4.4.70.0030.0236.64
4.4.60.0000.0236.64
4.4.50.0070.0236.64
4.4.40.0030.0436.64
4.4.30.0030.0306.64
4.4.20.0030.0276.64
4.4.10.0000.0236.64
4.4.00.0030.0336.64
4.3.110.0030.0306.64
4.3.100.0100.0206.64
4.3.90.0070.0276.64
4.3.80.0000.0336.64
4.3.70.0070.0176.64
4.3.60.0000.0276.64
4.3.50.0030.0276.64
4.3.40.0000.0406.64
4.3.30.0070.0276.64
4.3.20.0030.0336.64
4.3.10.0030.0276.64
4.3.00.0030.0276.48

preferences:
47.83 ms | 401 KiB | 5 Q