3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Contacts = [ [ 'name' => 'name 1', 'phone' => '12341234', 'email' => 'test@web.com' ], [ 'name' => 'name 1', 'phone' => '12341234', 'email' => 'test@web.com' ], [ 'name' => 'name 3', 'phone' => '4322342', 'email' => 'test@web1.com' ], [ 'name' => 'name 4', 'phone' => '1234123423', 'email' => 'test@web1.com' ], [ 'name' => 'name 5', 'phone' => '12341266634', 'email' => 'test@eqweqwweb.com' ], ]; $start = microtime(true); // function CheckDuplicteContacts($Contacts) // { if(count($Contacts) == 1){ return $validator = true; } else { $DuplicateLines = []; foreach($Contacts as $CurrentKey => $Contact) { foreach($Contacts as $SearchKey => $SearchContact) { if( ( ($SearchContact["name"] == $Contact["name"]) && ($SearchContact["email"] == $Contact["email"]) && ($SearchContact["phone"] == $Contact["phone"]) ) && ($SearchKey != $CurrentKey)) { array_push($DuplicateLines,$CurrentKey + 1); } } } $validator = empty($DuplicateLines) ? true : $DuplicateLines; } // } var_dump($validator); echo (microtime(true) -$start)*100;

preferences:
14.69 ms | 406 KiB | 5 Q