note 38763 deleted from function.settype by didou

From: Date: Tue, 06 Jan 2004 12:06:56 +0000
Subject: note 38763 deleted from function.settype by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62996@lists.php.net to get a copy of this message
Note Submitter: Nomikos ---- Note that you don't need to - or rather shouldn't - re-assign the variable of which you're changing the type, as settype() returns boolean true/false: <? $a = "1234"; var_dump($a); // string(4) "1234" settype($a, "int"); var_dump($a); // int(1234) $a = settype($a, "int"); var_dump($a); // bool(true) -> whoops! ?>

« previous php.notes (#62996) next »