From: dv at josheli dot com Operating system: Windows PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: defining a resource as a constant
Description: ------------ http://www.php.net/manual/en/language.constants.php "Only scalar data (boolean, integer, float and string) can be contained in constants." http://www.php.net/manual/en/function.mysql-connect.php "resource mysql_connect ( ... )" According to the documentation, "Expected result" is an E_NOTICE error or something, but I guess the "Actual result" below implies that a mysql link "resource" is actually an integer (4?). perhaps the documentation in either of the two places listed above, or in the define() man page, should reflect this fact? Reproduce code: --------------- $dbLink = mysql_connect($dbServerName, $dbUser, $dbPassword); define('DB_LINK',$dbLink); var_dump(DB_LINK); echo gettype(DB_LINK); Expected result: ---------------- see above. Actual result: -------------- resource(4) of type (mysql link) resource -- Edit bug report at http://bugs.php.net/?id=28102&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28102&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28102&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28102&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28102&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28102&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28102&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28102&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28102&r=support Expected behavior: http://bugs.php.net/fix.php?id=28102&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28102&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28102&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28102&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28102&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28102&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28102&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28102&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28102&r=float
