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.

For string values you can pass an empty string, for numbers 0 or a 
negative number and for objects 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.

I agree that it is a bad idea to introduce another weird syntax. We 
should either always allow null or never. I would prefer the first 
solution but could easily live with the second.

-- 
Ferdinand Beyer
<[EMAIL PROTECTED]>

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

Reply via email to