| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2005-06-24 15:22 UTC] tony2001@php.net
  [2005-06-24 15:34 UTC] clynx at succont dot de
  [2005-06-24 15:37 UTC] tony2001@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 06:00:01 2025 UTC | 
Description: ------------ When you try to use array_intersect in combination with a different Function, it leads to a strange Error Message. The Reproduce Code give the Error while the following does not: <?php $array1 = array('foo', 'bar', 'test'); $array2 = array('foo', 'me' ); $result = array_intersect( $array1, $array2 ); var_dump( array_shift( $result ) ); ?> And as far as array_intersect retuns an Array (a Variable ;o) this Error is a little bit strange. Reproduce code: --------------- <?php $array1 = array('foo', 'bar', 'test'); $array2 = array('foo', 'me' ); var_dump( array_shift( array_intersect( $array1, $array2 ) ) ); ?> Expected result: ---------------- webdev# php /htdocs/beta.webdev/succont.Unitized/test.php string(3) "foo" Actual result: -------------- webdev# php /htdocs/beta.webdev/succont.Unitized/test.php PHP Fatal error: Only variables can be passed by reference in /usr/local/htdocs/beta.webdev/succont.Unitized/test.php on line 4