3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $serials = [ [ "foo" => "", "bar" => "" ], [ "foo" => "", "bar" => "" ], [ "foo" => "", "bar" => "" ], [ "foo" => "", "bar" => "" ], [ "foo" => "", "bar" => "" ], [ "foo" => "Don't remove", "bar" => "me!" ] ]; $filteredArray = array_filter ($serials, function ($item) { return !empty(array_values($item)); }); var_dump($filteredArray);
based on empXC
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(6) { [0]=> array(2) { ["foo"]=> string(0) "" ["bar"]=> string(0) "" } [1]=> array(2) { ["foo"]=> string(0) "" ["bar"]=> string(0) "" } [2]=> array(2) { ["foo"]=> string(0) "" ["bar"]=> string(0) "" } [3]=> array(2) { ["foo"]=> string(0) "" ["bar"]=> string(0) "" } [4]=> array(2) { ["foo"]=> string(0) "" ["bar"]=> string(0) "" } [5]=> array(2) { ["foo"]=> string(12) "Don't remove" ["bar"]=> string(3) "me!" } }