Bug #70634 [NEW]: debug_backtrace() return value changed
| From: | kenji dot uui at gmail dot com | Date: | Sun, 04 Oct 2015 10:33:45 +0000 |
| Subject: | Bug #70634 [NEW]: debug_backtrace() return value changed | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196385@lists.php.net to get a copy of this message | ||
From: kenji dot uui at gmail dot com
Operating system: Linux
PHP version: 7.0.0RC4
Package: *General Issues
Bug Type: Bug
Bug description:debug_backtrace() return value changed
Description:
------------
The return value of debug_backtrace() was changed since php7.
Test script:
---------------
$ cat Proxy.php
<?php
class Proxy
{
public static function __callStatic($function, array $arguments)
{
if (self::checkCalledMethod($function))
{
}
}
public static function checkCalledMethod($function)
{
$trace = debug_backtrace();
var_dump($trace);
}
}
----- ----- ----- -----
$ cat Test.php
<?php
class Test
{
public function run()
{
Proxy::bar();
}
}
----- ----- ----- -----
$ cat app.php
<?php
require './Test.php';
require './Proxy.php';
$test = new Test();
$test->run();
----- ----- ----- -----
$ php app.php
Expected result:
----------------
PHP 5.6.10-dev
array(4) {
[0]=>
array(6) {
["file"]=>
string(34) "/vagrant/debug_backtrace/Proxy.php"
["line"]=>
int(7)
["function"]=>
string(17) "checkCalledMethod"
["class"]=>
string(5) "Proxy"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
&string(3) "bar"
}
}
[1]=>
array(6) {
["file"]=>
string(33) "/vagrant/debug_backtrace/Test.php"
["line"]=>
int(7)
["function"]=>
string(12) "__callStatic"
["class"]=>
string(5) "Proxy"
["type"]=>
string(2) "::"
["args"]=>
array(2) {
[0]=>
&string(3) "bar"
[1]=>
&array(0) {
}
}
}
[2]=>
array(6) {
["file"]=>
string(33) "/vagrant/debug_backtrace/Test.php"
["line"]=>
int(7)
["function"]=>
string(3) "bar"
["class"]=>
string(5) "Proxy"
["type"]=>
string(2) "::"
["args"]=>
array(0) {
}
}
[3]=>
array(7) {
["file"]=>
string(32) "/vagrant/debug_backtrace/app.php"
["line"]=>
int(7)
["function"]=>
string(3) "run"
["class"]=>
string(4) "Test"
["object"]=>
object(Test)#1 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
Actual result:
--------------
PHP 7.0.0-dev
array(3) {
[0]=>
array(6) {
["file"]=>
string(34) "/vagrant/debug_backtrace/Proxy.php"
["line"]=>
int(7)
["function"]=>
string(17) "checkCalledMethod"
["class"]=>
string(5) "Proxy"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
string(3) "bar"
}
}
[1]=>
array(6) {
["file"]=>
string(33) "/vagrant/debug_backtrace/Test.php"
["line"]=>
int(7)
["function"]=>
string(12) "__callStatic"
["class"]=>
string(5) "Proxy"
["type"]=>
string(2) "::"
["args"]=>
array(2) {
[0]=>
string(3) "bar"
[1]=>
array(0) {
}
}
}
[2]=>
array(7) {
["file"]=>
string(32) "/vagrant/debug_backtrace/app.php"
["line"]=>
int(7)
["function"]=>
string(3) "run"
["class"]=>
string(4) "Test"
["object"]=>
object(Test)#1 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
--
Edit bug report at https://bugs.php.net/bug.php?id=70634&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70634&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70634&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70634&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70634&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70634&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70634&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70634&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70634&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70634&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70634&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70634&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70634&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70634&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70634&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70634&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70634&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70634&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70634&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70634&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70634&r=mysqlcfg