3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mediaarray = array( array( 'file_type_id'=>'first file', 'other_stuff'=>'first other' ), array( 'file_type_id'=>'second file', 'other_stuff'=>'second other' ) ); $mediafiletype = array( array( 'id'=>'blabla', 'other'=>'first other' ), array( 'id'=>'second file', 'other'=>'second other' ) ); $baseUrlKeyMediaArray = array(); $NotbaseUrlKeyMediaArray = array(); foreach ($mediaarray as $key => $mavalue) { $match = false; foreach ($mediafiletype as $mftvalue) { if ($mavalue['file_type_id'] == $mftvalue['id']) { $pathname = $mftvalue['base_url']; $baseUrlKeyMediaArray[$pathname] = $mavalue; $match = true; } } if(! $match) { $NotbaseUrlKeyMediaArray[] = $mavalue; } } print_r($baseUrlKeyMediaArray); echo "<br />"; print_r($NotbaseUrlKeyMediaArray);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "base_url" in /in/au3jV on line 33 Array ( [] => Array ( [file_type_id] => second file [other_stuff] => second other ) ) <br />Array ( [0] => Array ( [file_type_id] => first file [other_stuff] => first other ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.54 ms | 402 KiB | 8 Q