Playing around with PHP 6 I noticed that some functions start to complain about conversion of null values to strings:

php -d error_reporting=65535 -r 'var_dump(urldecode(null));'

Warning: urldecode() expects parameter 1 to be strictly a binary string, null given in Command line code on line 1

I think this is wrong and attached a patch against HEAD to fix this. Note: While the patch seems a bit hacky at first it is IMHO the simplest solution without having to resort to copy/paste or goto. But if you want another solution I'm happy with that too :-)

- Chris
Index: Zend/zend_API.c
===================================================================
RCS file: /repository/ZendEngine2/zend_API.c,v
retrieving revision 1.466
diff -u -u -r1.466 zend_API.c
--- Zend/zend_API.c     25 Mar 2008 13:04:22 -0000      1.466
+++ Zend/zend_API.c     26 Mar 2008 00:46:19 -0000
@@ -464,6 +464,7 @@
                                                        *pl = 0;
                                                        break;
                                                }
+                                               c = 's';        /* Conversion 
from null is always allowed */
                                                /* break omitted intentionally 
*/
 
                                        case IS_UNICODE:

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to