debug_backtrace() returns information only about last call #15

Закрыто
открыта 2018-07-22 15:08:45 +02:00 belliash · 1 комментарий
belliash прокомментировал(а) 2018-07-22 15:08:45 +02:00
Владелец

Aer Information

  • Aer Version (or commit ref): 4c81475afb
  • Operating System: Linux
  • System Architecture (eg. arm, x86_64, ...): x86_64

Your problem description

debug_backtrace() does not return information all information as in PHP. See example code:

function test() {
    var_dump(debug_backtrace());
}
function a() {
    test();
}
a();

Expected result (from PHP):

array(2) {
[0] =>
array(4) {
'file' =>
string(8) "test.php"
'line' =>
int(8)
'function' =>
string(4) "test"
'args' =>
array(0) {
}
}
[1] =>
array(4) {
'file' =>
string(8) "test.php"
'line' =>
int(11)
'function' =>
string(1) "a"
'args' =>
array(0) {
}
}
}

Current results

array(4) {
 [function] =>
  string(4 'test')
 [args] =>
  array(0) {
   }
 [line] =>
  int(7)
 [file] =>
  string(8 'test.php')
 }
<!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please take a moment to check that your issue doesn't already exist. 3. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> # Aer Information - Aer Version (or commit ref): 4c81475afb - Operating System: Linux - System Architecture (eg. arm, x86_64, ...): x86_64 # Your problem description debug_backtrace() does not return information all information as in PHP. See example code: function test() { var_dump(debug_backtrace()); } function a() { test(); } a(); # Expected result (from PHP): array(2) { [0] => array(4) { 'file' => string(8) "test.php" 'line' => int(8) 'function' => string(4) "test" 'args' => array(0) { } } [1] => array(4) { 'file' => string(8) "test.php" 'line' => int(11) 'function' => string(1) "a" 'args' => array(0) { } } } # Current results array(4) { [function] => string(4 'test') [args] => array(0) { } [line] => int(7) [file] => string(8 'test.php') }
belliash добавил(а) метку enhancement 2018-07-22 15:08:45 +02:00
devnexen прокомментировал(а) 2018-07-22 16:41:58 +02:00
Участник

It is possible to retrieve all functions test and a but the VM holds only a bytecode sequence at a time, the last used, thus it will returns 11 in this case for both.

It is possible to retrieve all functions `test` and `a` but the VM holds only a bytecode sequence at a time, the last used, thus it will returns 11 in this case for both.
devnexen закрыл(а) эту задачу 2018-07-22 17:41:34 +02:00
devnexen упомянул эту задачу в коммите 2018-07-22 20:24:30 +02:00
devnexen упомянул эту задачу в коммите 2018-07-22 20:24:31 +02:00
devnexen был(а) назначен(а) belliash 2018-07-28 19:23:25 +02:00
Войдите, чтобы присоединиться к обсуждению.
2 участников
Уведомления
Срок выполнения
Срок выполнения не установлен.
Зависимости

Зависимостей нет.

Ссылка: aerscript/Aer#15