|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-14 10:32 UTC] stas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
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'