note 87829 deleted from function.get-resource-type by bjori

From: Date: Tue, 30 Dec 2008 19:17:13 +0000
Subject: note 87829 deleted from function.get-resource-type by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148692@lists.php.net to get a copy of this message
Note Submitter: chAlx ---- Fore some (all?) resources it's more effective to override the type instead of calling get_resource_type(): <?php $dbh = ibase_connect(); echo $dbh; // Resource id #3 echo (int)$dbh; // 3 echo gettype($dbh); // resource echo get_resource_type($dbh); // interbase link var_dump($dbh); // resource(3) of type (interbase link) ?> Integer 3 is more suitable for "if" tests than string "interbase link".

« previous php.notes (#148692) next »