|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39129 get_class_methods() guesses the existence of a constructor (4.4 only)
Submitted: 2006-10-11 18:25 UTC Modified: 2006-11-08 13:31 UTC
From: Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.4.4 OS: Irrelevant
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
28 - 5 = ?
Subscribe to this entry?

 [2006-10-11 18:25 UTC]
When instanciating a class without constructor, php will try to call the parent constructor.

This bug may may also be related to #39127.

get_class_methods() seems to guess that an imaginary constructor exists:

Reproduce code:
class a { function a() {} } 
class b extends a {} 
class c {}

$b = new b; 
$c = new c;

var_dump(get_class_methods($b), get_class_methods($c));

Expected result:
array(1) {
  string(1) "a"
array(0) {

Actual result:
array(2) {
  string(1) "a"
  string(1) "b"
array(0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-15 17:06 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.

 [2006-11-08 13:31 UTC]
The patch has been reverted, so the report should be "won't fix" for now.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Oct 01 23:05:53 2022 UTC