How about,

if (isset($b)) {
  $a = $b;
} else {
  $a = 10;
}

Or is that a bit too revolutionary? :)

The problems with these operators is that the logic you want here is rarely
simple, and when you need to refactor, you need to change your construct
back to if{}else{} often introducing bugs.  I see no reason to save ~ 10
keystrokes at the cost of readability.

-Sterling

-----Original Message-----
From: Marcus Boerger [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 16, 2004 3:29 PM
To: Andi Gutmans
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] Re: [RFC] ifsetor operator

Hello Andi,

Saturday, April 17, 2004, 12:17:49 AM, you wrote:

> I don't want to spoil the party but:
> a) I don't think we should add a new reserved word for this. I will try
and
> think of an alternative which uses the existing vocabulary.
> b) I would not want to add this before releasing PHP 5.0.0. I think we 
> should add it afterwards. We are not talking about a trivial patch here
and
> I believe that we should be in a deep feature freeze especially when it 
> comes to the core.
> c) As this is a new feature and people have done without it up to now, I 
> see no reason not to think of a good solution and wait with its
implementation.

> I've already talked to Marcus about this in the past and he agreed not to 
> make anymore such patches. It's not the first time where such harmless 
> engine changes were discovered to have more widespread effects.

yes we should wait until after 5.0. I never meant this to be commited
to 5.0. But having the patch at hand gives the people to play with it.
And i guess enough people know how to change the keyword. Having said
this i hope we  reach a consensus on either a good name or a new
operator.

marcus



-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]

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

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

Reply via email to