3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace f; function test() { test2(); } if (version_compare('5.4', PHP_VERSION) < 1) { function test2() { print_r(getnext(debug_backtrace(0, 2))); } } else { function test2() { print_r(getnext(debug_backtrace(0))); } } function getnext($a) { return current(array_slice($a, 1, 1, true)); } for ($i = 0; $i <= 5000; $i++) { test(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 12
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 12
Branch analysis from position: 17
Branch analysis from position: 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
filename:       /in/8Jq3p
function name:  (null)
number of ops:  18
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_NS_FCALL_BY_NAME                                    'f%5Cversion_compare'
          1        SEND_VAL_EX                                              '5.4'
          2        FETCH_CONSTANT                                   ~1      'f%5CPHP_VERSION'
          3        SEND_VAL_EX                                              ~1
          4        DO_FCALL                                      0  $2      
          5        IS_SMALLER                                               $2, 1
          6      > JMPZ                                                     ~3, ->9
   10     7    >   DECLARE_FUNCTION                                         'f%5Ctest2'
   12     8      > JMP                                                      ->10
   14     9    >   DECLARE_FUNCTION                                         'f%5Ctest2'
   23    10    >   ASSIGN                                                   !0, 0
         11      > JMP                                                      ->15
   24    12    >   INIT_NS_FCALL_BY_NAME                                    'f%5Ctest'
         13        DO_FCALL                                      0          
   23    14        PRE_INC                                                  !0
         15    >   IS_SMALLER_OR_EQUAL                                      !0, 5000
         16      > JMPNZ                                                    ~7, ->12
   25    17    > > RETURN                                                   1

Function f%5Ctest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Jq3p
function name:  f\test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_NS_FCALL_BY_NAME                                    'f%5Ctest2'
          1        DO_FCALL                                      0          
    7     2      > RETURN                                                   null

End of function f%5Ctest

Function %00f%5Ctest2%2Fin%2F8Jq3p%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Jq3p
function name:  f\test2
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_NS_FCALL_BY_NAME                                    'f%5Cprint_r'
          1        INIT_NS_FCALL_BY_NAME                                    'f%5Cgetnext'
          2        INIT_NS_FCALL_BY_NAME                                    'f%5Cdebug_backtrace'
          3        SEND_VAL_EX                                              0
          4        SEND_VAL_EX                                              2
          5        DO_FCALL                                      0  $0      
          6        SEND_VAR_NO_REF_EX                                       $0
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR_NO_REF_EX                                       $1
          9        DO_FCALL                                      0          
   12    10      > RETURN                                                   null

End of function %00f%5Ctest2%2Fin%2F8Jq3p%3A10%240

Function %00f%5Ctest2%2Fin%2F8Jq3p%3A14%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Jq3p
function name:  f\test2
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_NS_FCALL_BY_NAME                                    'f%5Cprint_r'
          1        INIT_NS_FCALL_BY_NAME                                    'f%5Cgetnext'
          2        INIT_NS_FCALL_BY_NAME                                    'f%5Cdebug_backtrace'
          3        SEND_VAL_EX                                              0
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR_NO_REF_EX                                       $0
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR_NO_REF_EX                                       $1
          8        DO_FCALL                                      0          
   16     9      > RETURN                                                   null

End of function %00f%5Ctest2%2Fin%2F8Jq3p%3A14%241

Function f%5Cgetnext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Jq3p
function name:  f\getnext
number of ops:  12
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_NS_FCALL_BY_NAME                                    'f%5Ccurrent'
          2        INIT_NS_FCALL_BY_NAME                                    'f%5Carray_slice'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAL_EX                                              1
          5        SEND_VAL_EX                                              1
          6        SEND_VAL_EX                                              <true>
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR_NO_REF_EX                                       $1
          9        DO_FCALL                                      0  $2      
         10      > RETURN                                                   $2
   21    11*     > RETURN                                                   null

End of function f%5Cgetnext

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.6 ms | 1403 KiB | 28 Q