ID:               33466
 Updated by:       [EMAIL PROTECTED]
 Reported By:      clynx at succont dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: FreeBSD 4.10/FreeBSD 5.4/WinXP
 PHP Version:      5CVS-2005-06-24 (dev)
 New Comment:

array_shift() accepts only variables passed by reference.
Obviously an expression result is not a variable.


Previous Comments:
------------------------------------------------------------------------

[2005-06-24 15:18:58] clynx at succont dot de

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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33466&edit=1

Reply via email to