ID: 38821 Updated by: [EMAIL PROTECTED] Reported By: tklingenberg at lastflood dot com -Status: Open +Status: Bogus Bug Type: Variables related Operating System: win32 PHP Version: 5.1.6 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php bool settype ( mixed &var, string type ) Previous Comments: ------------------------------------------------------------------------ [2006-09-14 09:51:04] tklingenberg at lastflood dot com Description: ------------ settype() needs a variable passed by reference. if this variable is not defined/set, it does not throw an error. instead, and that is the bug per se, settype creates the variable passed "by reference". Reproduce code: --------------- <? /* $var does not exsits, this throws an error */ var_dump($var); /* settype should work on existing vars only (by &reference) */ $r = settype($var, "string"); /* $var does exist now */ var_dump($var); ?> Expected result: ---------------- <br /> <b>Notice</b>: Undefined variable: var in <b>test.php</b> on line <b>3</b><br /> NULL <br /> <b>Notice</b>: Undefined variable: var in <b>test.php</b> on line <b>6</b><br /> NULL Actual result: -------------- <br /> <b>Notice</b>: Undefined variable: var in <b>test.php</b> on line <b>3</b><br /> NULL string(0) "" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38821&edit=1
