[PHP4BETA] IS_* macros

From: Date: Mon, 10 May 1999 22:02:15 +0000
Subject: [PHP4BETA] IS_* macros
Groups: php.version4 
Request: Send a blank email to php-version4+get-742@lists.php.net to get a copy of this message
Is there any reason the IS_* macros were defined to have sequential values instead of multiples of 2 like php3? #define IS_LONG 1 #define IS_DOUBLE 2 #define IS_STRING 3 #define IS_ARRAY 4 #define IS_OBJECT 5 #define IS_BC 6 /* for parser internal use only */ #define IS_BOOL 7 #define IS_RESOURCE 8 #define IS_CONSTANT 9 #define IS_METHOD 10 /* for overloaded function calls */ and php3 had #define IS_LONG 0x1 #define IS_DOUBLE 0x2 #define IS_STRING 0x4 #define IS_ARRAY 0x8 #define IS_USER_FUNCTION 0x10 #define IS_INTERNAL_FUNCTION 0x20 #define IS_CLASS 0x40 #define IS_OBJECT 0x80 It was so much more convenient to check if the variable was not array or object by doing: if (!(value->type & (IS_ARRAY|IS_OBJECT)) and with current macros you can't do that now. Can that be changed? -Andrey * Black holes are where God divided by zero. * -- PHP 4 Beta

« previous php.version4 (#742) next »