php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #528 please ingore above - gettype() now even worse!!!
Submitted: 1998-07-09 08:53 UTC Modified: 1998-07-09 19:01 UTC
From: be at SHonline dot DE Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Latest CVS OS: solaris 2.5.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: be at SHonline dot DE
New email:
PHP Version: OS:

 

 [1998-07-09 08:53 UTC] be at SHonline dot DE
Now gettype is totally inconsistent:

Now
-------
$b = array();
 
function b() { ; }
 
print gettype($b);
-------

retruns "array" which is perfectly correct.

But
-------
class A { 
 var $a = array();
 function a() { ; }
}
 
$o = new A;
print gettype($o->a);
-------

returns "user function" which is not only false, but also
inconsistent to what gettype() returns in the upper case.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-09 19:01 UTC] ssb
What you do above is to first define a property $a and
then immediately replace it to the function a().
This is a side-effect of the way classes are currently
implemented (they share the same name space, and are really
just associative arrays with sugar on top).  It is not
an inconsistency, but the parser probably ought to
croak if you replace properties this way.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 00:01:27 2024 UTC