PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_Compat » Bug #4605

debug_print_backtrace - Object to string conversion

Details

Submitted2005-06-16 13:31 UTC
Fromlists at co-comp dot co dot uk
Assignedaidan
StatusClosed
PackagePHP_Compat
PHP Version4.3.11
OSLinux FC3
Roadmaps1.6.0a1

Comments

[2005-06-16 13:31 UTC] lists at co-comp dot co dot uk

Description:
------------
I use a db_die function which calls debug_print_backtrace().

Essentially, debug_print_backtrace() is trying to implode an object and gives an object to string conversion error.

Also, debug_print_backtrace2() is what's defined and checked for - had to change it to debug_print_backtrace() to get it to work :-/ ymmv

pear list shows:
PHP_Compat 1.4.0 stable

Reproduce code:
---------------
-if (!function_exists('debug_print_backtrace2')) {
- function debug_print_backtrace2()
+if (!function_exists('debug_print_backtrace')) {
+ function debug_print_backtrace()

if (isset($call['args'])) {
$params = implode(', ', $call['args']); //<== this line causes the problem
}

Expected result:
----------------
PHP 5.0.4
#0 db_die(ADODB_mysql Object ([databaseType] => mysql,[dataProvider] => mysql, etc

Actual result:
--------------
PHP 4.3.11
Notice: Object to string conversion in /usr/share/pear/PHP/Compat/Function/debug_print_backtrace.php on line 53

#0 db_die() called etc

[2005-06-16 13:40 UTC] lists at co-comp dot co dot uk

Looks like the backtrace2 thing was fixed in the cvs version - it's just not in the 'stable' released version!!

http://cvs.php.net/diff.php/pear/PHP_Compat/Compat/Function/debug_print_backtrace.php?r1=1.1&r2=1.2&ty=u

Rest of bug report is still an issue though :)