PHP 4.0 Bug #6741 Updated: gettype of 'user function' returns null

From: Date: Mon, 25 Sep 2000 20:41:48 +0000
Subject: PHP 4.0 Bug #6741 Updated: gettype of 'user function' returns null
Groups: php.dev 
Request: Send a blank email to php-dev+get-33619@lists.php.net to get a copy of this message
ID: 6741 User Update by: ping@alt.it Status: Analyzed Bug Type: Documentation problem Description: gettype of 'user function' returns null The doc at http://www.php.net/manual/function.gettype.php says: > gettype -- Get the type of a variable > Description > string gettype (mixed var) > Returns the type of the PHP variable var. > Possibles values for the returned string are: > "boolean" > "integer" > "double" > "string" > "array" > "object" > "resource" > "user function" > "unknown type" I wonder what happens with other types as 'object' or 'resource' Anyway the string 'NULL' doesn't seem to be among the possible returned values. Previous Comments: --------------------------------------------------------------------------- [2000-09-23 22:26:27] stas@php.net I don't see any mention in the manual that gettype should work on functions - only on variables. In fact, it cannot veen return "user function" now, so I put it in doc's problem. --------------------------------------------------------------------------- [2000-09-20 05:23:16] ping@alt.it It WAS undocumented but working on php3. It IS documented and doesn't work on php4 <? class class1 { function classfunction1() { $b=2; } } $myclass=new class1; echo "classfunction1 is of type ", gettype($myclass->classfunction1),"<br>n"; ?> --------------------------------------------------------------------------- [2000-09-16 18:21:49] stas@php.net Please provide a code example. Also, I guess you should never rely on undocumented behaviour to preserve, anyway. --------------------------------------------------------------------------- [2000-09-13 19:16:44] ping@alt.it gettype() on function names returns null Although undocumented, in version 3 it properly returned 'user function'. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6741

« previous php.dev (#33619) next »