PHP 4.0 Bug #5588: Returned values from a declared function are cutoff

From: Date: Fri, 14 Jul 2000 14:28:20 +0000
Subject: PHP 4.0 Bug #5588: Returned values from a declared function are cutoff
Groups: php.dev 
Request: Send a blank email to php-dev+get-24450@lists.php.net to get a copy of this message
From: malmond@vt.edu Operating system: Linux x86 and PPC and FreeBSD 3.5/4 PHP version: 4.0.0 PHP Bug Type: Other Bug description: Returned values from a declared function are cutoff what is happening on all the above mentioned platforms is that a function that is declared when it returns more than one value it will only return the first character from each return. function foo() { hit database with sql statement (this also works with other statements, not just db) get the results (fetch_row) return($row[0]); // eq Well return($row[1]); // eq Hello return($row[2]); // eq Dolly } // end function $myVals = foo(); print($myVals[0]); // prints "W" print($myVals[1]); // prints "H" print($myVals[2]); // prints "D" this has occurred on many platforms all running PHP 4.0.0 ( can not get a working binary of 4.0.1; compile errors) with either hitting MySQL (3.22.32 and 3.23.19) and PostgreSQL 7.0.2; as well as by executing a general statement in the function. This occurs only with multiple returns from a function with a single return there is no problem. The platforms are Linux 2.2.15 Mandrake 6.1, FreeBSD 3.5 and 4, YellowDog LinuxPPC Champion 1.2. All compiled with the following: './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-config-file-path=/etc/httpd' '--enable-track-vars' '--enable-magic-quotes' '--enable-calendar' '--with-jpeg-dir=/usr/local/jpeg' '--with-tiff=/usr/include' '--with-db3=/usr/local/BerkeleyDB.3.1' '--enable-ftp' '--with-gd=/usr/local/gd' '--with-ttf=/usr/include/freetype' '--with-ldap=/usr/local/openldap' '--with-mysql=/usr/local/mysql' '--with-pgsql=/usr/local/pgsql' '--enable-trans-sid' '--enable-memory-limit' '--with-gnu-ld' '--with-png=/usr/local'

« previous php.dev (#24450) next »