Edit report at http://bugs.php.net/bug.php?id=50563&edit=1

 ID:                 50563
 Comment by:         dan at teton dot com
 Reported by:        phi...@php.net
 Summary:            removing E_WARNING from parse_url()
 Status:             Open
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   N/A
 PHP Version:        5.3.2RC1
 Block user comment: N
 Private report:     N

 New Comment:

This is STILL throwing E_WARNING.  Not good.


Previous Comments:
------------------------------------------------------------------------
[2010-06-16 20:56:26] paj...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=300501
Log: - #50563, removing E_WARNING from parse_url()

------------------------------------------------------------------------
[2010-05-24 16:30:57] phi...@php.net

I don't think the bit fields should be used to hide the warning.

------------------------------------------------------------------------
[2010-05-24 15:38:58] ka...@php.net

The following patch has been added/updated:

Patch Name: parse-url-bitfields
Revision:   1274708338
URL:       
http://bugs.php.net/patch-display.php?bug=50563&patch=parse-url-bitfields&revision=1274708338

------------------------------------------------------------------------
[2010-05-24 15:36:44] paj...@php.net

Derick, I don't see why you would change the return value here. Please
explain your reasoning.



However the patch to remove the warning can be applied already, as I
explained on internals.

------------------------------------------------------------------------
[2010-05-24 15:18:53] ka...@php.net

I did a quick and dirty patch to turn the $component into a bitfield

allowing you to do:

$url = parse_url('http://www.php.net/manual/', PHP_URL_HOST |
PHP_URL_PATH);

printf('%s%s', $url['host'], $url['path']);



At the same point I figured we could disable the warning and therefore

I added a new constant named PHP_URL_SILENT:

$broken_url = 'http:///www.php.net/';

var_dump(parse_url($broken_url), parse_url($broken_url,
PHP_URL_SILENT));



It doesn't alter the actual URL parser code to tell why the parsing

failed, but it kills two flies in one hit. Ofcourse the silent option

can be skipped, but while atleast updating parse_url().



The patch uploaded here does not currently fix any broken tests.



Theres a minor BC break, since it changes the values of the constants,

but it can be fixed by changing the checking code, or the dirty way to

increase the values so they don't conflict with the old ones.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=50563


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=50563&edit=1

Reply via email to