New Operator

From: Date: Tue, 14 Mar 2006 01:30:35 +0000
Subject: New Operator
Groups: php.internals 
Request: Send a blank email to internals+get-22388@lists.php.net to get a copy of this message
Hello internals, Since nobody could seem to agree on a language construct for accessing a variable that you don't know exists (ifsetor), I would like to propose a simpler approach. It returns the value of the passed variable, or NULL if the variable does not exist. ifset($some_array['some-key-you-are-not-sure-exists']); This E_STRICT ternary pain-in-the-ass expression is constantly at the top of every PHP script I write: $ConfirmCode = (isset($_GET['ConfirmCode']) ? $_GET['ConfirmCode'] : ''); Please? -- Best regards, Jason Garber mailto:jason@ionzoft.com IonZoft, Inc.

« previous php.internals (#22388) next »