3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ 'http://www.yandex.ru', 'http://www.mail.ru', 'http://www.google.com' ]; $response = [ ['http://www.mail.ru', 200, 'some other string'], ['http://www.yandex.ru', 200, 'some string'], ['http://www.google.com', 200, 'yet another string'] ]; var_export( array_values( array_replace( array_flip($input), array_column($response, null, 0) ) ) );
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
array ( 0 => array ( 0 => 'http://www.yandex.ru', 1 => 200, 2 => 'some string', ), 1 => array ( 0 => 'http://www.mail.ru', 1 => 200, 2 => 'some other string', ), 2 => array ( 0 => 'http://www.google.com', 1 => 200, 2 => 'yet another string', ), )

preferences:
104.4 ms | 408 KiB | 5 Q