Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48421 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14856 invoked from network); 24 May 2010 06:12:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2010 06:12:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=brian@moonspot.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=brian@moonspot.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain moonspot.net designates 72.5.90.27 as permitted sender) X-PHP-List-Original-Sender: brian@moonspot.net X-Host-Fingerprint: 72.5.90.27 smtp.dealnews.com Linux 2.5 (sometimes 2.4) (4) Received: from [72.5.90.27] ([72.5.90.27:55103] helo=smtp.dealnews.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/14-21629-AD81AFB4 for ; Mon, 24 May 2010 02:12:43 -0400 Received: (qmail 2123 invoked from network); 24 May 2010 06:12:31 -0000 Received: from unknown (HELO mail.dealnews.com) (10.1.10.7) by -H with ESMTPS (DHE-RSA-AES256-SHA encrypted); 24 May 2010 06:12:31 -0000 Received: (qmail 29257 invoked from network); 24 May 2010 06:12:39 -0000 Received: from h105.248.18.98.static.ip.windstream.net (HELO macdough.local) (brianm@98.18.248.105) by -H with ESMTPA; 24 May 2010 06:12:39 -0000 Message-ID: <4BFA18D6.5030209@moonspot.net> Date: Mon, 24 May 2010 01:12:38 -0500 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Ilia Alshanetsky CC: Ralph Schindler , internals References: <4BF6A90D.8020901@smashlabs.com> <4BF6AD07.7090001@moonspot.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Fixes for parse_url, bug 50563 From: brian@moonspot.net (Brian Moon) Because that is, IMO, a bad precedent to start for PHP internal functions. Too many functions already produce warnings (fopen) and return a status that can be checked. The solution right now is @ and that has so much baggage with it that you can now disable that feature completely making distributed software not be able to deal with these functions and return useful messages instead of spewing warnings uncontrollably. I am all for turning off warnings when a function returns a success/failure status. Brian. -------- http://brian.moonspot.net/ On 5/22/10 9:42 AM, Ilia Alshanetsky wrote: > Instead of removing a warning, why not add an additional parameter to the > function that would instruct it to silence warning messages on parse > failure? > > On Fri, May 21, 2010 at 11:55 AM, Brian Moon wrote: > >> +1 >> >> >> Brian. >> -------- >> http://brian.moonspot.net/ >> >> >> On 5/21/10 10:38 AM, Ralph Schindler wrote: >> >>> >>> Hey all, >>> >>> Attached is a patch to remove the warning from parse_url() in situations >>> where parse_url() cannot actually parse the url. The bug report also >>> claims there should be a new feature for understanding "why" a parsed >>> url failed. That code currently does not exist, and the current warning >>> gives no more information than simply returning false does. >>> >>> http://bugs.php.net/bug.php?id=50563 >>> >>> The first patch is against trunk. I think we should at least get this >>> done even if the group decides that down the line we want the why >>> portion explained as well (I actually don't care about the why part). >>> That feature would require that php_url_parse_ex() add some parsing >>> intellignce, this would not be a 1 or 2 line feature implementation. >>> >>> The motivation is that since false and E_WARN are redunant, this patch >>> would allow developers to STOP using @parse_url(), which we have to do. >>> >>> I also suggest that we apply this to the PHP_5_3 branch. This behavior >>> should be backwards compatible with everyone that is actually using the >>> @parse_url() in their code. The only 1-off situation that might be >>> affected is if people are catching the error with an error handler and >>> branching there. Why they wouldn't be branching off the false return >>> value, I don't know. >>> >>> Both patches contain test fixes. >>> >>> Is there anything more I need? Is this commit worthy? >>> >>> Thanks, >>> Ralph >>> >>> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >