From:             jsheets at idahoimageworks dot com
Operating system: FreeBSD
PHP version:      5CVS-2005-06-27 (dev)
PHP Bug Type:     Scripting Engine problem
Bug description:  Fatal error: Only variables can be passed by reference with 
array_shift

Description:
------------
Starting with PHP 5.1 beta #2 PHP dies with a 

PHP Configuration:

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-pgsql=/usr/local/pgsql''--enable-ftp' '--with-zlib-dir=/usr'
'--with-config-file-path=/usr/local/apache2/conf'
'--with-jpeg-dir=/usr/local'

PHP Versions: 5.1 BETA #2 and PHP 5.1 latest CVS

Reproduce code:
---------------
    /**
     * Returns the part of the filename before the .
     * @param string $file
     * @return string
    */
    function GetBaseName($file)
    {
        if (empty($file)) {
            return false;
        }

       // simplified, $file replaced with file.txt
       return array_shift(explode('.', 'file.txt')));       
    }

Expected result:
----------------
The expected result is that PHP returns the portion of the filename before
the ., 

Actual result:
--------------
Results in Fatal error: Only variables can be passed by reference

Error seems to have been introduced between beta 5.1 beta #1 and #2, it
works in PHP 4 as well as PHP 5.0.x and PHP 5.1 beta #1



-- 
Edit bug report at http://bugs.php.net/?id=33495&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33495&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33495&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33495&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33495&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33495&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33495&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33495&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33495&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33495&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33495&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33495&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33495&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33495&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33495&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33495&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33495&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33495&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33495&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33495&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33495&r=mysqlcfg

Reply via email to