3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exclusions = [ 'Discontinue Status' => [ 'Discontinued', 'Run Down Stock', ], 'Hazardous' => [ 'No', ], ]; $products = [ [ 'Product ID' => '452', 'Discontinue Status' => 'Discontinued', 'Hazardous' => 'No', ], [ 'Product ID' => '463', 'Discontinue Status' => 'Normal', 'Hazardous' => 'No', ], [ 'Product ID' => '477', 'Discontinue Status' => 'Run Down Stock', 'Hazardous' => 'Yes', ], [ 'Product ID' => '502', 'Discontinue Status' => 'Discontinued', 'Hazardous' => 'No', ], [ 'Product ID' => '520', 'Discontinue Status' => 'Normal', 'Hazardous' => 'Yes', ], ]; var_export( array_values( array_filter( $products, function($product) use ($exclusions) { return !array_filter( array_intersect_key($product, $exclusions), function($value, $key) use ($exclusions) { return in_array($value, $exclusions[$key]); }, ARRAY_FILTER_USE_BOTH ); } ) ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'Product ID' => '520', 'Discontinue Status' => 'Normal', 'Hazardous' => 'Yes', ), )

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:
63.1 ms | 401 KiB | 8 Q