Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] [PATCH] Allow null to string conversion for PHP 6 [RSS Feed]

#1 March 26, 2008 01:56:00

Christian S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] [PATCH] Allow null to string conversion for PHP 6


Playing around with PHP 6 I noticed that some functions start tocomplain 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 1I 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 simplestsolution without having to resort to copy/paste or goto. But if you wantanother solution I'm happy with that too :-)- ChrisIndex: 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

Offline

#2 March 26, 2008 10:09:41

Antony D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] [PATCH] Allow null to string conversion for PHP 6


On 26.03.2008 03:55, Christian Schneider wrote:
> 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 applied slightly different patch, but it does exactly the same.
Thanks for the heads up.

--
Wbr,
Antony Dovgal

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

Offline

  • Root
  • » PHP
  • » [PHP-DEV] [PATCH] Allow null to string conversion for PHP 6 [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support