|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27008 Every class method can be called as static
Submitted: 2004-01-22 13:31 UTC Modified: 2004-01-25 01:14 UTC
From: hoesh at dorsum dot hu Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2004-01-22 (dev) OS: *
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:
48 - 38 = ?
Subscribe to this entry?

 [2004-01-22 13:31 UTC] hoesh at dorsum dot hu
Any method of any class can be called staticly. Internals and scripted ones too.
* TipOfTheDay *
Call any internal class's constructor from outside of object. As object doesn't exists, and ZE2 calls the internal constructor, process crashes immadiately.

Reproduce code:
<? domdocument::domdocument(); ?>
, or
<? domdocument::__construct(); ?>
both works, to crash the process.
class check
  function not_static()
    echo "Impossible, but works!";

Expected result:
Warning or fatal error.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-25 01:14 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

You can still call any method statically. If it's not possible in the specific case, an error will be output.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 22:01:41 2021 UTC