3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $source_packages = array( 'one' => array ('param1' => 'val11', 'param2' => 'val21'), 'two' => array ('param1' => 'val21', 'param2' => 'val22') ); $packages_from = $source_packages; $package_key = 'two'; $package_value = $source_packages[$package_key]; $packages_to = array($package_key => $package_value); $result_packages = array_diff_assoc($packages_from, $packages_to); var_dump($result_packages); echo "\n";
based on A6G6m
Output for 5.4.0 - 7.1.0
Notice: Array to string conversion in /in/CRhEX on line 11 Notice: Array to string conversion in /in/CRhEX on line 11 array(1) { ["one"]=> array(2) { ["param1"]=> string(5) "val11" ["param2"]=> string(5) "val21" } }
Output for 4.3.0 - 5.3.29
array(1) { ["one"]=> array(2) { ["param1"]=> string(5) "val11" ["param2"]=> string(5) "val21" } }