note 51723 deleted from function.define by tularis

From: Date: Sun, 03 Jun 2007 09:41:18 +0000
Subject: note 51723 deleted from function.define by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127155@lists.php.net to get a copy of this message
Note Submitter: dsan at pml dot ac dot uk ---- Just to clarify what 'david at nospam webgroup dot org' said: ${} is actually the syntax for 'variable variables'. So in this specific case: Starting with the line: ${MY_CONST} = serialize(array('foo' => 'bar')); PHP will expand the constant and use it as the name of the variable: $test = serialize(array('foo' => 'bar')); So in fact there is no assignment to a constant (which would defy the definition of 'constant') but instead an assignment to a variable named by the _value_ of the constant.

« previous php.notes (#127155) next »