note 110762 deleted from control-structures.alternative-syntax by danbrown

From: Date: Tue, 04 Dec 2012 18:36:19 +0000
Subject: note 110762 deleted from control-structures.alternative-syntax by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-192271@lists.php.net to get a copy of this message
Note Submitter: klebercal at gmail dot com ---- The example below does not work with echo() because it evaluates the print() return value. Remember that print() always returns 1, while echo does not return anything. That's why this works and simulates an IF statement: <?php $value = 'Something'; isset($value) AND print('Works'); ?> While this gives you a parse error: <?php $value = 'Something'; isset($value) AND echo('Works'); ?>

« previous php.notes (#192271) next »