php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31061 debug_print_backtrace reports wrong classes
Submitted: 2004-12-11 17:37 UTC Modified: 2005-01-12 02:11 UTC
From: matjaz dot ostroversnik at ztm dot si Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.0.2 OS: FC
Private report: No CVE-ID: None
 [2004-12-11 17:37 UTC] matjaz dot ostroversnik at ztm dot si
Description:
------------
debug_print_backtrace reports wrong class context in a constructor.

Linux version 2.6.7-1.478
PHP 5.0.3RC1 and RC2

Reproduce code:
---------------
 <?php
class a
{
  function __construct () 
    {
      echo ("this is a\n");
      debug_print_backtrace();
    }
}
class b extends a
{
  function __construct () 
    {
      echo ("this is b\n");
      parent::__construct();
    }
}
$x = new b();
?> 


Expected result:
----------------
this is b
this is a
#0  a->__construct() called at [/home/ostri/xulapps/alf/php/cl_test.php:15]
#1  b->__construct() called at [/home/ostri/xulapps/alf/php/cl_test.php:18]


Actual result:
--------------
this is b
this is a
#0  b->__construct() called at [/home/ostri/xulapps/alf/php/cl_test.php:15]
#1  b->__construct() called at [/home/ostri/xulapps/alf/php/cl_test.php:18]


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-12 02:11 UTC] tony2001@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Duplicate of #30828.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 04:01:36 2025 UTC