Re: Re: Construct Request

From: Date: Thu, 15 Apr 2004 16:44:42 +0000
Subject: Re: Re: Construct Request
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-9196@lists.php.net to get a copy of this message
On 15 Apr 2004 at 11:47, Jason Garber wrote: > a. the actual variable in question could not be passed This is wrong, too. Look at this example: <?php error_reporting(E_ALL | E_STRICT); function param(&$param, $default, $type = null) { if (!isset($param)) { $param = $default; } if (is_string($type)) { settype($param, $type); } } $_GET['Exists'] = 0; param($_GET['Exists'], 1, 'string'); param($_GET['Does']['Not']['Exist'], 1, 'double'); var_dump($_GET); ?> Output: ---------------------------------------- array(2) { ["Exists"]=> string(1) "0" ["Does"]=> array(1) { ["Not"]=> array(1) { ["Exist"]=> float(1) } } } Exactly the behavior you are looking for. Not even an E_NOTICE. -- Ferdinand Beyer <fb@fbeyer.com>

« previous php.internals (#9196) next »