php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38204 self is a string
Submitted: 2006-07-25 09:02 UTC Modified: 2006-07-25 09:11 UTC
From: info at rhalff dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.4 OS: Debian
Private report: No CVE-ID: None
 [2006-07-25 09:02 UTC] info at rhalff dot com
Description:
------------
self seems te be a string until a method is called on it.

this makes it impossible to get any information about self at all.

Reproduce code:
---------------
<?php
class Heh {
 
    static function hi() {
        echo "Type of self is: ".gettype(self)."\n";
        var_dump(self);
        echo "Calling method huh, on self which is a string!?\n";
        self::huh();
    }
 
    static function huh() {
        echo "huh?\n";
    }
 
}
 
Heh::hi();

Expected result:
----------------
self is anything but a string.

Actual result:
--------------
Type of self is: string
string(4) "self"
Calling method huh, on self which is a string!?
huh?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-25 09:11 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 06:01:32 2025 UTC