Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Alexey Zakhlestin
On Thu, Dec 31, 2009 at 7:10 AM, Stanislav Malyshev s...@zend.com wrote: Hi! One of the many things that is chaotic in PHP is what internal function returns when invalid parameters are given (i.e. params parsing fails). Most of those functions do one of: 1a. just return - this happens with

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Richard Quadling
2009/12/31 Alexey Zakhlestin indey...@gmail.com: On Thu, Dec 31, 2009 at 7:10 AM, Stanislav Malyshev s...@zend.com wrote: Hi! One of the many things that is chaotic in PHP is what internal function returns when invalid parameters are given (i.e. params parsing fails). Most of those functions

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Stanislav Malyshev
Hi! Would changing the returning value to Null to indicate invalid arguments (or any other error condition) would create a significant BC surely? Just how many functions are documented with the entity return.falseforfailure;? (198 files using this so far vs Return null; which is used very

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Richard Quadling
2009/12/31 Stanislav Malyshev s...@zend.com: Hi! Would changing the returning value to Null to indicate invalid arguments (or any other error condition) would create a significant BC surely? Just how many functions are documented with the entity return.falseforfailure;? (198 files using this

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Derick Rethans
On Thu, 31 Dec 2009, Stanislav Malyshev wrote: Would changing the returning value to Null to indicate invalid arguments (or any other error condition) would create a significant BC surely? Just how many functions are documented with the entity return.falseforfailure;? (198 files using

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Zeev Suraski
At 14:20 31/12/2009, Derick Rethans wrote: On Thu, 31 Dec 2009, Stanislav Malyshev wrote: Would changing the returning value to Null to indicate invalid arguments (or any other error condition) would create a significant BC surely? Just how many functions are documented with the entity

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Johannes Schlüter
On Thu, 2009-12-31 at 12:20 +, Derick Rethans wrote: Hmm, I don't actually think many people test whether parsing parameters failed, but they do test the return value. AFAIK, our standard is to return NULL for parameter parsing failures (at least that's what all the examples in

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Philip Olson
On Dec 31, 2009, at 5:22 AM, Johannes Schlüter wrote: On Thu, 2009-12-31 at 12:20 +, Derick Rethans wrote: Hmm, I don't actually think many people test whether parsing parameters failed, but they do test the return value. AFAIK, our standard is to return NULL for parameter parsing

Re: [PHP-DEV] invalid params return value

2009-12-31 Thread Stanislav Malyshev
Hi! This is also the documented as the general convention: http://de.php.net/manual/en/functions.internal.php While there are exceptions to this on purpose: For instance get_object is documented to Return FALSE if /object/ is not an object (this exception was discussed in detail in the past)

[PHP-DEV] invalid params return value

2009-12-30 Thread Stanislav Malyshev
Hi! One of the many things that is chaotic in PHP is what internal function returns when invalid parameters are given (i.e. params parsing fails). Most of those functions do one of: 1a. just return - this happens with most standard ext code, which was converted from old params parsing to a