Re: [PHP-DEV] substr passing null...

2009-02-03 Thread Lukas Kahwe Smith
On 27.01.2009, at 17:36, Nathanael D. Noblet wrote: showing that passing null as the third param for substr is somehow interpreted to mean no length or something. Is this indeed a bug then? and if so where can I submit it? Please submit a documentation bug if this change is not yet covere

Re: [PHP-DEV] substr passing null...

2009-01-29 Thread Johannes Schlüter
Hi, On Thu, 2009-01-29 at 09:29 +0100, David Zülke wrote: > Out of curiosity - how hard would it be to implement a "default" > keyword that can be passed in function/method calls with the new > parameter parsing API? It would mean to introduce a new value type or tons of rewrites. But as I s

Re: [PHP-DEV] substr passing null...

2009-01-29 Thread David Zülke
Am 28.01.2009 um 18:41 schrieb Scott MacVicar: Nathanael D. Noblet wrote: Peter Walther wrote: it's only a bug if you always expect optional NULL parameters to be ignored. Well that's the question I'm asking. I assumed optional parameters passed null should be ignored. If this isn't the beha

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Kalle Sommer Nielsen
Hello 2009/1/28 Kenan R Sulayman : > Why don't make the function return FALSE if parameter equals NULL ? Well the $start parameter is required for substr(), so I don't see the deal here? But with now initalizers being added in the manual by Jakub its not much of a deal to use those values if you

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Kenan R Sulayman
Why don't make the function return FALSE if parameter equals NULL ? -- (c) Kenan Sulayman Freelance Designer and Programmer Life's Live Poetry 2009/1/28 Paul Biggar > On Wed, Jan 28, 2009 at 6:39 PM, Dan wrote: > >> > >> You're assumption is wrong then, NULL isn't treated as not passing a >

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Paul Biggar
On Wed, Jan 28, 2009 at 6:39 PM, Dan wrote: >> >> You're assumption is wrong then, NULL isn't treated as not passing a >> value. The reason it worked with substr was by pure chance. >> > > Out of interest, is there a reason that that is the case? Surely passing > null would be best treated as the

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Dan
> > You're assumption is wrong then, NULL isn't treated as not passing a > value. The reason it worked with substr was by pure chance. > Out of interest, is there a reason that that is the case? Surely passing null would be best treated as the same as passing nothing?

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Scott MacVicar
Nathanael D. Noblet wrote: > Peter Walther wrote: > > it's only a bug if you always expect optional NULL parameters to be >> ignored. > > Well that's the question I'm asking. I assumed optional parameters > passed null should be ignored. If this isn't the behaviour php uses, > then I'm good, but

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Nathanael D. Noblet
Peter Walther wrote: > it's only a bug if you always expect optional NULL parameters to be ignored. Well that's the question I'm asking. I assumed optional parameters passed null should be ignored. If this isn't the behaviour php uses, then I'm good, but I've used passing null to optional pa

Re: [PHP-DEV] substr passing null...

2009-01-28 Thread Peter Walther
On 27.01.2009 17:36, Nathanael D. Noblet wrote: Johannes Schlüter wrote: I know Ilia recently fixed a few functions that didn't ignore null parameters, but it doesn't appear that substr() was one of them. I guess that's part of the zend_parse_parameters changes. As we now use the "s" modifier

Re: [PHP-DEV] substr passing null...

2009-01-27 Thread Nathanael D. Noblet
Johannes Schlüter wrote: I know Ilia recently fixed a few functions that didn't ignore null parameters, but it doesn't appear that substr() was one of them. I guess that's part of the zend_parse_parameters changes. As we now use the "s" modifier for instance which might better be a "s!". We sho

Re: [PHP-DEV] substr passing null...

2009-01-27 Thread Johannes Schlüter
Hi, On Mon, 2009-01-26 at 17:05 -0800, Christopher Jones wrote: > > Nathanael D. Noblet wrote: > > Hello, > > I just have a question, often there are 'optional' parameters to > > functions, I've always thought that most of the time I could pass null > > to these if I wanted to leave one emp

Re: [PHP-DEV] substr passing null...

2009-01-26 Thread Christopher Jones
Nathanael D. Noblet wrote: > Hello, > I just have a question, often there are 'optional' parameters to > functions, I've always thought that most of the time I could pass null > to these if I wanted to leave one empty. This has as far as I can tell > always worked except recently I was using s

[PHP-DEV] substr passing null...

2009-01-26 Thread Nathanael D. Noblet
Hello, I just have a question, often there are 'optional' parameters to functions, I've always thought that most of the time I could pass null to these if I wanted to leave one empty. This has as far as I can tell always worked except recently I was using substr(). If I pass null to the thir