php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52465 Some Thing Wrong With The debug_backtrace()
Submitted: 2010-07-28 05:33 UTC Modified: 2010-07-30 14:05 UTC
From: clark21330 at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.3 OS: Windows Vista
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: clark21330 at gmail dot com
New email:
PHP Version: OS:

 

 [2010-07-28 05:33 UTC] clark21330 at gmail dot com
Description:
------------
Did you see the Output of the script?

but why the type of "method a" was "->" it must be "::"!

because I use it with the static method...

maybe it isn't a bug but it's really a big problem to me


AND. I'm poor at English~~~... Please forgive me~

Test script:
---------------
class R{
	function a(){
		print_r(debug_backtrace());
	}
}
class X{
	function b(){
		
		R::a();
	}
}
$A = new X;
echo $A->b();


Expected result:
----------------
Array
(
    [0] => Array
        (
            [file] => G:\Site\Test2\1.php
            [line] => 11
            [function] => a
            [class] => R
            [object] => X Object
                (
                )
 
            [type] => ->
            [args] => Array
                (
                )
 
        )
 
    [1] => Array
        (
            [file] => G:\Site\Test2\1.php
            [line] => 15
            [function] => b
            [class] => X
            [object] => X Object
                (
                )
 
            [type] => ->
            [args] => Array
                (
                )
 
        )
 
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-28 14:13 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-07-28 14:13 UTC] johannes@php.net
This happens due to PHP 4 compatibility. You have to mark the method static to get the correct result.
 [2010-07-30 13:51 UTC] clark21330 at gmail dot com
I see... My Bad...
 [2010-07-30 14:05 UTC] clark21330 at gmail dot com
And there is another question~

How can my script executed currently on both PHP4 and 5
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC