|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1222 $this point does not contain function list
Submitted: 1999-03-11 14:51 UTC Modified: 1999-03-13 08:34 UTC
From: jonsmirl at mediaone dot net Assigned:
Status: Closed Package: Other
PHP Version: 3.0.7 OS: Win95
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
31 + 11 = ?
Subscribe to this entry?

 [1999-03-11 14:51 UTC] jonsmirl at mediaone dot net
A pointer to an object is not behaving the same as the $this pointer inside of the same object.

$obj = new oObject;

class oObject {
    function checkme($obj) { 

// this list will include the member function and properties
        while ( list( $key, $val ) = each( $obj ) ) { 
            printf("AA %s => %s (%s)", $key, $val, gettype($val)); 

// this list only shows the properties
        while ( list( $key, $val ) = each( $this ) ) { 
            printf("BB %s => %s (%s)", $key, $val, gettype($val)); 

I would have expected the $this pointer to provide me with the list of functions too.

I need this function list to construct a remote proxy to the object.

Jon Smirl


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-13 08:34 UTC] sas
You are not resetting the object properly. This works:

class Object {
    function checkme($obj) {

        while(list($key, $val) = each($obj)) {
            printf("AA %s => %s (%s)\n", $key, $val, gettype($val));


        while(list($key, $val) = each($this)) {
            printf("BB %s => %s (%s)\n", $key, $val, gettype($val));

$obj = new Object;

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 10 04:01:26 2023 UTC