Hello Ferdinand,

Monday, May 10, 2004, 6:01:12 PM, you wrote:

> On 10 May 2004 at 11:31, Jason Garber wrote:

>> The only way I see that as being useful is to be able to assume 
> that you 
>> can safely say   $bar->DoSomething()    from within your function 
> WITHOUT 
>> FIRST HAVING TO write an if() statement that verifies that it is not 
> null.

> On the other hand in many situations it is useful to be able to pass 
> an empty value, e.g. setHandler(HandlerClass $a) could be called 
> with setHandler(null) to remove the handler.

This is simply a design mistake. If you set something to NULL then
that is very different from removing or with PHP syntax unsetting
an entry. What you need is another method to do that say
unsetHandler().

> For string values you can pass an empty string, for numbers 0 or a 
> negative number and for objects null.

And for all but the objects you can be pass NULL, too. Which then
has a complete different effect/sense/result/semantik since:
NULL !== 0
NULL !== ""
NULL === NULL

> In other languages it is always possible to pass null instead of the 
> object (e.g. Java), in C/C++, every pointer may be set to null.

We don't have ponters. We pass references with PHP 5. And for references
C++ doesn't allow NULL either. It is in some situations accomplishable
but then results in SEGVs.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to