Proposal for extending gettype()

From: Date: Wed, 30 Oct 2002 13:39:24 +0000
Subject: Proposal for extending gettype()
Groups: php.dev 
Request: Send a blank email to php-dev+get-90318@lists.php.net to get a copy of this message
Hi, I am curious what's is the opinion of the devs about adding new additional parameter to gettype which won't be compulsory. Using it instead of returning a string the function will return an int which. As an addition new consts will be registered - something like IS_STRING, IS_LONG and so on. The reason for that there won't be a need of using long if - elseif (the types in php are not 2 or 3) but a single switch(). Ilia suggested the use of a hash which can be indexed by the values which are returned from gettype() now. So what's your opinion. Andrey

« previous php.dev (#90318) next »