Re: substr passing null...
| From: | Kalle Sommer Nielsen | Date: | Thu, 29 Jan 2009 06:47:44 +0000 |
| Subject: | Re: substr passing null... | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-42873@lists.php.net to get a copy of this message | ||
Hello
2009/1/28 Kenan R Sulayman <kureal@kkooporation.de>:
> 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 wanna use the
default anyway. For example mysql_connect:
http://www.php.net/mysql_connect
But I do agree that in the end it would be easier to just be able to
pass NULL, but it can just have a different meaning ;)
>
> --
> (c) Kenan Sulayman
> Freelance Designer and Programmer
>
> Life's Live Poetry
>
>
> 2009/1/28 Paul Biggar <paul.biggar@gmail.com>
>
>> On Wed, Jan 28, 2009 at 6:39 PM, Dan <dan@dancryer.com> 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 same as passing nothing?
>>
>> NULL is a value. There is no way to tell that when you pass NULL, you
>> actually intended to pass nothing and use the default value.
>>
>> Paul
>>
>>
>> --
>> Paul Biggar
>> paul.biggar@gmail.com
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--
Kalle Sommer Nielsen