note 105597 deleted from language.operators.comparison by danbrown

From: Date: Wed, 31 Aug 2011 14:08:26 +0000
Subject: note 105597 deleted from language.operators.comparison by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182859@lists.php.net to get a copy of this message
Note Submitter: David Rodrigues ---- Ternary Operators is only to PHP 5.3, but you can do somethink similar on older versions. <?php // PHP 5.3 $data = 5; $data = $data ?: 10; // PHP 5.2 or lower $data = 5; !$data && $data = 10; ?> Note that, if $data is undefined, it will continues undefined, different of real Ternary Operator.

« previous php.notes (#182859) next »