Re: Questionable behaviour of variable variables

From: Date: Mon, 15 Apr 2002 15:06:05 +0000
Subject: Re: Questionable behaviour of variable variables
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-82809@lists.php.net to get a copy of this message
<?php $varname = ""; $GLOBALS[$varname] = new stdClass(); $GLOBALS[""]->{""} = "bar"; $GLOBALS[$varname]->$varname = "foo"; ?> Any difference to what you did? Should PHP spit out warnings every time a developer does something that it considers stupid? Most languages fully support the user shooting themselves in the foot -- PHP is not alone in this :)

« previous php.dev (#82809) next »