note 93138 modified in control-structures.break by danbrown

From: Date: Tue, 25 Aug 2009 16:24:55 +0000
Subject: note 93138 modified in control-structures.break by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159878@lists.php.net to get a copy of this message
When using the switch statement you still have to escape your vars like this: case 'banner': This also works, but >banner< is interpreted as a constant and as it is not defined an E_NOTICE is triggered and the constant name it self (='banner') is returned: case banner: Just wanted to clarify this, so people don't get a wrong idea. Christian Gahlert --was-- Just to clarify the post below from webmaster at kayfar dot com: When using the switch statement you still have to escape your vars like this: case 'banner': This also works, but >banner< is interpreted as a constant and as it is not defined an E_NOTICE is triggered and the constant name it self (='banner') is returned: case banner: Just wanted to clarify this, so people don't get a wrong idea. Christian Gahlert http://php.net/manual/en/control-structures.break.php

« previous php.notes (#159878) next »