note 69745 deleted from function.array-diff by nlopess
| From: | nlopess@php.net | Date: | Tue, 19 Sep 2006 15:32:26 +0000 |
| Subject: | note 69745 deleted from function.array-diff by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117322@lists.php.net to get a copy of this message | ||
Note Submitter: mco at mco dot hdtv dot pl
----
Dear Thorsten Schaak, you made a mistake.
Your example is buggy, not PHP. Check the proper syntax, check PHP errors/warnings/notices
PHP deals okay with empty arrays, try yourself:
<?php
$a = array( 'a', 'b', 'c', 'd', 'e' );
$b = array( 'b', 'c' );
$c = array( ) ;
print_r( array_diff( $a, $b ) );
print_r( array_diff( $a, $c ) );
print_r( array_diff( $c, $b ) );
print_r( array_diff( $c, $c ) );
?>