X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=php%2Fplc_api.php;fp=php%2Fplc_api.php;h=41f65c212aecd81ae28f7cd1d1e1ceb3b2e63633;hb=71242511f93381fde9bae82e32f705a3f7dd7aff;hp=322460115b3c3fbe5e422bce36b5037135381e00;hpb=ee9209667367de49fb2430251cdb741cdb8e427c;p=plcapi.git diff --git a/php/plc_api.php b/php/plc_api.php index 3224601..41f65c2 100644 --- a/php/plc_api.php +++ b/php/plc_api.php @@ -61,9 +61,13 @@ class PLCAPI function backtrace_php () { $backtrace = debug_backtrace(); $msg = ""; - foreach( $backtrace as $line ) { + $len = count($backtrace); + $cnt = 1; + foreach( array_reverse($backtrace) as $line ) { $msg .= "File '". $line['file'] . "' line " . $line['line'] . "\n"; $msg .= " " . $line['function'] . "( " . $this->rec_join($line['args']) . ")\n"; + $cnt += 1; + if ( $cnt == $len ) { break; } } return $msg; }