Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36524 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41065 invoked from network); 26 Mar 2008 00:55:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Mar 2008 00:55:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.6 Received: from [195.226.6.51] ([195.226.6.51:35099] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/45-28012-EFE99E74 for ; Tue, 25 Mar 2008 19:55:28 -0500 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 12BDB16A736 for ; Wed, 26 Mar 2008 01:55:24 +0100 (CET) Received: from unknown by localhost (amavisd-new, unix socket) id client-XX7x2YQc for ; Wed, 26 Mar 2008 01:55:21 +0100 (CET) Received: from box.local (84-72-92-81.dclient.hispeed.ch [84.72.92.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id CF65616A72A for ; Wed, 26 Mar 2008 01:55:20 +0100 (CET) Message-ID: <47E99EF8.1080404@cschneid.com> Date: Wed, 26 Mar 2008 01:55:20 +0100 User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/mixed; boundary="------------010409060307010804050009" X-Virus-Scanned: amavisd-new at gna.ch Subject: [PATCH] Allow null to string conversion for PHP 6 From: cschneid@cschneid.com (Christian Schneider) --------------010409060307010804050009 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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 --------------010409060307010804050009 Content-Type: text/plain; name="null_conversion_allowed.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="null_conversion_allowed.patch.txt" 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: --------------010409060307010804050009--