3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [["id"=>"111","email_adr"=>"AAA","ad_owner_email"=>"BBB"], ["id"=>"111","email_adr"=>"BBB","ad_owner_email"=>"CCC"], ["id"=>"111","email_adr"=>"BBB","ad_owner_email"=>"AAA"], //<--discarded ["id"=>"500","email_adr"=>"QQQ","ad_owner_email"=>"PPP"], ["id"=>"500","email_adr"=>"PPP","ad_owner_email"=>"QQQ"], //<--discarded ["id"=>"999","email_adr"=>"PPP","ad_owner_email"=>"QQQ"], //<-saved because id=999 ["id"=>"888","email_adr"=>"PPP","ad_owner_email"=>"QQQ"], ["id"=>"888","email_adr"=>"PPP","ad_owner_email"=>"QQQ"], ["id"=>"888","email_adr"=>"QQQ","ad_owner_email"=>"PPP"], //<--discarded ]; $tmp1 = []; $array = array_map("unserialize", array_unique(array_map("serialize", $array))); function getIndex($data,$ne){ foreach($data as $key=>$val){ if ($val['id'] === $ne['c'] && $val['email_adr'] === $ne['a'] && $val['ad_owner_email'] === $ne['b']) return $key; } return -1; } foreach($array as $record){ $tmp1[$record['id']][$record['email_adr']][] = $record['ad_owner_email']; } // print_r($tmp1); foreach($array as $ind=>$record){ $id = $record['id']; $em_owner = $record['ad_owner_email']; $em_adr = $record['email_adr']; if (isset( $tmp1[$id][$em_owner] ) && !empty( $tmp1[$id][$em_owner] ) && in_array( $em_adr, $tmp1[$id][$em_owner] ) && in_array( $em_owner, $tmp1[$id][$em_adr] ) ) { $tm1 = array_search($em_adr, $tmp1[$id][$em_owner]); $tm2 = array_search($em_owner, $tmp1[$id][$em_adr]); $in = getIndex($array, ['a'=>$em_owner, 'b'=>$em_adr, 'c'=>$id]); unset( $tmp1[$id][$em_adr][$tm2] ); unset( $tmp1[$id][$em_owner][$tm1] ); unset( $array[$in] ); } } sort($array); print_r($array);

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.0110.00618.98
8.5.00.0160.00520.20
8.4.150.0010.00114.05
8.4.140.0140.01317.54
8.4.130.0150.00618.62
8.4.120.0040.00520.90
8.4.110.0120.00722.59
8.4.100.0090.00317.63
8.4.90.0120.01018.51
8.4.80.0130.00719.44
8.4.70.0090.00817.97
8.4.60.0120.00918.76
8.4.50.0100.01118.64
8.4.40.0000.02017.93
8.4.30.0090.00620.48
8.4.20.0130.00717.68
8.4.10.0120.00317.92
8.3.280.0110.01018.58
8.3.270.0120.01116.73
8.3.260.0040.00416.54
8.3.250.0130.00618.84
8.3.240.0100.01016.60
8.3.230.0120.00716.86
8.3.220.0060.01117.24
8.3.210.0120.00616.84
8.3.200.0070.00216.82
8.3.190.0140.00519.21
8.3.180.0110.00616.52
8.3.170.0150.00319.03
8.3.160.0140.00416.67
8.3.150.0160.00319.05
8.3.140.0060.01217.34
8.3.130.0000.00818.42
8.3.120.0030.00720.60
8.3.110.0060.01220.94
8.3.100.0090.00316.76
8.3.90.0060.00326.77
8.3.80.0110.00019.36
8.3.70.0090.00618.30
8.3.60.0070.00716.75
8.3.50.0070.00923.64
8.3.40.0070.00718.58
8.3.30.0110.00418.65
8.3.20.0080.00021.85
8.3.10.0040.00421.73
8.3.00.0040.00421.73
8.2.290.0100.00820.71
8.2.280.0140.00618.65
8.2.270.0120.00618.88
8.2.260.0030.00516.69
8.2.250.0150.00318.36
8.2.240.0030.00717.25
8.2.230.0060.00322.58
8.2.220.0050.00324.06
8.2.210.0070.01126.77
8.2.200.0100.00318.88
8.2.190.0150.00016.63
8.2.180.0070.00716.88
8.2.170.0070.00722.96
8.2.160.0040.01120.35
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0000.00826.16
8.2.110.0060.00322.29
8.2.100.0060.00617.72
8.2.90.0050.00317.75
8.2.80.0060.00318.82
8.2.70.0000.00918.05
8.2.60.0000.00818.16
8.2.50.0040.00418.05
8.2.40.0040.00418.16
8.2.30.0040.00419.55
8.2.20.0000.00818.10
8.2.10.0040.00419.23
8.2.00.0050.00319.28
8.1.330.0110.00921.80
8.1.320.0080.01118.57
8.1.310.0100.00718.29
8.1.300.0030.00719.66
8.1.290.0030.00730.84
8.1.280.0100.01025.92
8.1.270.0040.00422.19
8.1.260.0080.00026.35
8.1.250.0120.00328.09
8.1.240.0100.00723.84
8.1.230.0070.00319.10
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0000.00917.23
8.1.180.0080.00018.10
8.1.170.0000.00717.62
8.1.160.0000.00718.91
8.1.150.0040.00418.86
8.1.140.0000.00720.66
8.1.130.0030.00320.35
8.1.120.0000.00717.49
8.1.110.0000.00717.51
8.1.100.0040.00417.38
8.1.90.0030.00717.50
8.1.80.0000.00717.48
8.1.70.0030.00717.35
8.1.60.0000.00817.59
8.1.50.0030.00617.52
8.1.40.0050.00317.56
8.1.30.0000.00817.73
8.1.20.0060.00317.70
8.1.10.0060.00317.53
8.1.00.0070.00017.54
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.38
8.0.270.0000.00718.14
8.0.260.0000.00720.05
8.0.250.0050.00317.07
8.0.240.0030.00316.93
8.0.230.0040.00416.90
8.0.220.0000.00817.00
8.0.210.0000.00716.88
8.0.200.0040.00416.98
8.0.190.0000.00716.96
8.0.180.0030.00516.98
8.0.170.0040.00816.87
8.0.160.0030.00316.86
8.0.150.0050.00316.96
8.0.140.0000.00716.91
8.0.130.0000.00613.42
8.0.120.0000.00716.84
8.0.110.0000.00716.96
8.0.100.0040.00416.77
8.0.90.0030.00616.92
8.0.80.0150.01116.86
8.0.70.0020.00517.00
8.0.60.0000.00716.84
8.0.50.0030.00516.92
8.0.30.0130.00317.18
8.0.20.0100.01017.07
8.0.10.0040.00317.16
8.0.00.0140.01016.57
7.4.330.0000.00516.71
7.4.320.0030.00316.43
7.4.300.0080.00016.59
7.4.290.0040.00416.57
7.4.280.0070.00016.64
7.4.270.0030.00316.54
7.4.260.0000.00513.26
7.4.250.0000.00716.49
7.4.240.0070.00016.57
7.4.230.0070.00016.36
7.4.220.0030.00416.65
7.4.210.0070.00716.56
7.4.200.0050.00216.36
7.4.140.0060.01117.86
7.4.130.0160.00716.54
7.4.120.0110.00716.68
7.4.110.0030.01516.49
7.4.100.0180.00616.77
7.4.90.0160.00616.61
7.4.80.0070.01119.39
7.4.70.0060.01216.66
7.4.60.0160.00316.74
7.4.50.0100.00716.36
7.4.40.0060.01116.67
7.4.20.0160.00716.47
7.4.10.0110.01116.50
7.4.00.0120.00616.54
7.3.330.0040.00416.39
7.3.320.0030.00313.36
7.3.310.0030.00316.50
7.3.300.0040.00416.40
7.3.290.0060.01116.33
7.3.280.0070.00716.37
7.3.260.0070.01116.59
7.3.230.0070.01016.59
7.3.210.0170.00416.44
7.3.200.0110.00616.66
7.3.190.0070.01016.47
7.3.180.0130.01016.21
7.3.170.0070.01416.48
7.3.160.0070.01016.46
7.3.130.0060.01216.62
7.3.120.0030.01416.54
7.3.110.0130.00316.65
7.3.100.0070.01116.53
7.3.90.0100.00716.45
7.3.80.0030.01316.27
7.3.70.0080.01116.33
7.3.60.0130.00316.41
7.3.50.0130.00316.49
7.3.40.0060.00916.47
7.3.30.0050.01116.43
7.3.20.0110.00616.49
7.3.10.0090.00916.30
7.3.00.0080.00816.46
7.2.330.0120.01316.70
7.2.320.0060.01016.50
7.2.310.0120.00616.72
7.2.300.0030.01516.77
7.2.290.0030.01316.80
7.2.260.0000.01816.77
7.2.250.0110.00516.79
7.2.240.0100.00616.53
7.2.230.0070.01016.77
7.2.220.0070.01016.91
7.2.210.0150.00316.60
7.2.200.0090.01516.70
7.2.190.0000.01716.57
7.2.180.0100.00716.66
7.2.170.0080.00816.66
7.2.160.0130.00316.68
7.2.150.0070.01116.64
7.2.140.0140.00316.69
7.2.130.0030.01316.60
7.2.120.0100.00716.61
7.2.110.0100.00716.73
7.2.100.0070.01016.84
7.2.90.0030.01316.57
7.2.80.0150.00816.67
7.2.70.0060.01316.74
7.2.60.0080.01316.76
7.2.50.0130.00516.86
7.2.40.0130.00316.72
7.2.30.0090.00916.91
7.2.20.0150.00916.67
7.2.10.0100.01416.74
7.2.00.0100.01416.80

preferences:
169.46 ms | 403 KiB | 5 Q