[PHP-DEV] [VOTE] 5.4 features vote

2011-07-08 Thread Stas Malyshev
Hi! I've created a voting page for the features in 5.4 TODO list for which we need to find consensus. Please go there: https://wiki.php.net/todo/php54/vote and vote! See also links to relevant RFCs on the TODO page: https://wiki.php.net/todo/php54 If something is unclear or you notice a mist

Re: [PHP-DEV] [PATCH] getimagesize - return named keys for width, height, type and attributes

2011-07-08 Thread Richard Quadling
On 8 July 2011 17:21, DIXON P. wrote: > Thanks Richard, > > Renamed and attached. > > -Original Message- > From: Richard Quadling [mailto:rquadl...@gmail.com] > Sent: 08 July 2011 17:13 > To: DIXON P. > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] [PATCH] getimagesize - return name

RE: [PHP-DEV] [PATCH] getimagesize - return named keys for width, height, type and attributes

2011-07-08 Thread DIXON P.
Thanks Richard, Renamed and attached. -Original Message- From: Richard Quadling [mailto:rquadl...@gmail.com] Sent: 08 July 2011 17:13 To: DIXON P. Cc: internals@lists.php.net Subject: Re: [PHP-DEV] [PATCH] getimagesize - return named keys for width, height, type and attributes On 8 Jul

Re: [PHP-DEV] preg_match

2011-07-08 Thread Ferenc Kovacs
On Fri, Jul 8, 2011 at 6:09 PM, Richard Quadling wrote: > On 8 July 2011 16:31, Mike Robinson wrote: >> On July-08-11 10:01 AM Rafael Dohms wrote: >> >> [snip] >> >>> first time using preg_match is a nightmare. >> >> IMHO, preg_match is poetry in motion. >> >> Going through a million lines of cod

Re: [PHP-DEV] [PATCH] getimagesize - return named keys for width, height, type and attributes

2011-07-08 Thread Richard Quadling
On 8 July 2011 17:10, DIXON P. wrote: > Hi, > > I've attached a patch ... Rename as .txt to get through the mailing list s/w. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP Internals - PHP Runtime Development Mailin

[PHP-DEV] [PATCH] getimagesize - return named keys for width, height, type and attributes

2011-07-08 Thread DIXON P.
Hi, I've attached a patch for getimagesize() that returns named keys for image width, height, type and attributes values. The equivalent numeric keys 0, 1,2 and 3 are still returned but could perhaps be deprecated in the future? The patch also contains updated tests to reflect the change. Regar

Re: [PHP-DEV] preg_match

2011-07-08 Thread Richard Quadling
On 8 July 2011 16:31, Mike Robinson wrote: > On July-08-11 10:01 AM Rafael Dohms wrote: > > [snip] > >> first time using preg_match is a nightmare. > > IMHO, preg_match is poetry in motion. > > Going through a million lines of code replacing ereg[i] with preg_match > because it was deprecated in 5

RE: [PHP-DEV] preg_match

2011-07-08 Thread Mike Robinson
On July-08-11 10:01 AM Rafael Dohms wrote: [snip] > first time using preg_match is a nightmare. IMHO, preg_match is poetry in motion. Going through a million lines of code replacing ereg[i] with preg_match because it was deprecated in 5.3 - *that* is a nightmare. Best Regards Mike Robinson

Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug53727.phpt branches/PHP_5_3/Zend/tests/is_a.phpt branches/PHP_5_3/Zend/zend_builtin_functions.c bran

2011-07-08 Thread Ralph Schindler
Oh by all means, kill the warning. The behavior is sound though (the fix for the issue reported in #53727 where a missing parent *ce would affect the is_a_impl()'s ability to correctly determine it's subtype. The question is, should we keep the warning in 5.4? I'd say no, I think false should

Re: [PHP-DEV] preg_match

2011-07-08 Thread Alexey Shein
2011/7/8 Rafael Dohms : > Still, this is preg_match it only returns one match, why should i get > a array and have to use ugly things like $matches[0] afterwards? > It just makes for very ugly syntax and extra code, a simple function > would make this cleaner and more intuitive, first time using >

Re: [PHP-DEV] preg_match

2011-07-08 Thread Rafael Dohms
Still, this is preg_match it only returns one match, why should i get a array and have to use ugly things like $matches[0] afterwards? It just makes for very ugly syntax and extra code, a simple function would make this cleaner and more intuitive, first time using preg_match is a nightmare. -- Ra

Re: [PHP-DEV] preg_match

2011-07-08 Thread Ivan Enderlin @ Hoa
Hi Rafael :-), On 08/07/11 15:18, Rafael Dohms wrote: On Fri, Jul 8, 2011 at 9:20 AM, Nikita Popov wrote: The most common use for preg_match is validation: if (!preg_match('~...~', $string)) { /* do something */ } Here $matches is not required, only the 0/1 return value of preg_match is of i

Re: [PHP-DEV] preg_match

2011-07-08 Thread Nikita Popov
No, you don't need to initialize $matches. It's passed by reference and thus doesn't need to be initialized. And as I already said: It is good practice to ensure that preg_match actually matched something: if (preg_match(REGEX, $string, $matches)) { // in here $matches is guaranteed to be defi

Re: [PHP-DEV] preg_match

2011-07-08 Thread Rafael Dohms
On Fri, Jul 8, 2011 at 9:20 AM, Nikita Popov wrote: > The most common use for preg_match is validation: > > if (!preg_match('~...~', $string)) { /* do something */ } > > Here $matches is not required, only the 0/1 return value of preg_match is of > interest. > > Furthermore, even if you need $matc

Re: [PHP-DEV] Re: [PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug53727.phpt branches/PHP_5_3/Zend/tests/is_a.phpt branches/PHP_5_3/Zend/z

2011-07-08 Thread Daniel Convissor
Hi Folks: On Thu, Jul 07, 2011 at 02:20:50PM -0700, Stas Malyshev wrote: > > In fact, I'm not sure why would we need such warning at all. Unknown > class - return false, who cares? +1 Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intens

Re: [PHP-DEV] preg_match

2011-07-08 Thread Nikita Popov
The most common use for preg_match is validation: if (!preg_match('~...~', $string)) { /* do something */ } Here $matches is not required, only the 0/1 return value of preg_match is of interest. Furthermore, even if you need $matches, you should always combine it with an if: if (!preg_match('~.

[PHP-DEV] preg_match

2011-07-08 Thread Rafael Dohms
I was wondering if anyone ever thought of either fixing or writing a new function that would make preg_match actually work in a way that made sense? right now i need to pass in a optional parameter that will receive the match, in this case one or no match, why should this not be the function's ret