Edit report at http://bugs.php.net/bug.php?id=53170&edit=1
ID: 53170 User updated by: gmblar+php at gmail dot com Reported by: gmblar+php at gmail dot com Summary: Cannot substract Arrays Status: Open Type: Feature/Change Request Package: Arrays related Operating System: Linux PHP Version: 5.3.3 Block user comment: N New Comment: Expect same behavior as array_diff() http://de.php.net/manual/en/function.array- diff.php Previous Comments: ------------------------------------------------------------------------ [2010-10-26 17:37:21] gmblar+php at gmail dot com Description: ------------ Add is supported but substract Arrays not Test script: --------------- <?php $foo = array('a' => 1, 'b' => 2); $bar = array('c' => 3, 'd' => 4); $foobar = $foo + $bar; print_r($foobar); $foo = $foobar - $bar; print_r($foo); ?> Expected result: ---------------- Array ( [a] => 1 [b] => 2 [c] => 3 [d] => 4 ) Array ( [a] => 1 [b] => 2 ) Actual result: -------------- Array ( [a] => 1 [b] => 2 [c] => 3 [d] => 4 ) Fatal error: Unsupported operand types in array.php on line 9 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53170&edit=1