3v4l.org

run code in 300+ PHP versions simultaneously
<?php $registerArray = array( 'Sleutel' => 1, 'Gebouw_ID' => '20250043814' , 'Toestel_ID' => 'BE071 (S035)' , 'object_id' => null, 'Code MCS' => '2_22_00350', 'Type_deur' => 'Schuifpoort', 'Merk' => 'Came' , 'Type_Merk' => 'Schuifpoort', 'Locatie' => 'Station', 'Op_Controller' => '', 'Omschrijving' => 'ANTCE_PRSCH/BRCOU_Ploegstraat inkom portier', 'Voedingskast' => '', 'Automaat' => '', 'Eigenaar' => '', 'Keuzeschakelaar' => '', 'Toegangssleutels' => '', 'Indienstname' => '0000-00-00', 'Onderhoudsfirma' => '61/92/13/00851', 'Onderhoudsnummer_contractant' => '', 'Opmerkingen' => '10_SLO_026C', 'OPMonderhoud' => '', 'id' => 10, 'register' => 'register_pompen', 'sleutel' => 1, 'action' => 'create', 'date' => '2019-03-22 08:52:39', 'status' => 1, 'done' => 0 ); $order = array( 'object_id', 'Code MCS', 'DeviceType', 'Toestel_ID', 'Locatie', 'Type_deur', 'Op_Controller', 'Omschrijving', '', '', '', '', '', '', 'Onderhoudsfirma', 'Onderhoudsnummer_contractant', 'Eigenaar', 'Toegangssleutels', 'Indienstname', '', 'Type_Merk', '', '', '', 'Merk', 'Sleutel', 'Gebouw_ID', '', '', '', 'Opmerkingen', 'OPMonderhoud' ); $newArray = array(); foreach ($order as $k) { if (array_key_exists($k, $registerArray)) { $newArray[] = $registerArray[$k]; } else { $newArray[] = ''; } } print_r($newArray);
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 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.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Array ( [0] => [1] => 2_22_00350 [2] => [3] => BE071 (S035) [4] => Station [5] => Schuifpoort [6] => [7] => ANTCE_PRSCH/BRCOU_Ploegstraat inkom portier [8] => [9] => [10] => [11] => [12] => [13] => [14] => 61/92/13/00851 [15] => [16] => [17] => [18] => 0000-00-00 [19] => [20] => Schuifpoort [21] => [22] => [23] => [24] => Came [25] => 1 [26] => 20250043814 [27] => [28] => [29] => [30] => 10_SLO_026C [31] => )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
185.35 ms | 408 KiB | 5 Q