3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('PHP_VERSION_ID')) { $version = explode('.', PHP_VERSION); define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); } function a($depth = 0) { //return last backtrace call. If backtrace bigger then 3, return third call. if($depth === 1000) { if(PHP_VERSION_ID >= 50400) { return array_slice(array_slice(debug_backtrace(~ DEBUG_BACKTRACE_PROVIDE_OBJECT & ~ DEBUG_BACKTRACE_IGNORE_ARGS, 3), 0, 3), -1, 1); } elseif(PHP_VERSION_ID >= 50306) { return array_slice(array_slice(debug_backtrace(~ DEBUG_BACKTRACE_PROVIDE_OBJECT), 0, 3), -1, 1); } elseif(PHP_VERSION_ID >= 50205) { return array_slice(array_slice(debug_backtrace(FALSE), 0, 3), -1, 1); } else return array_slice(array_slice(debug_backtrace(), 0, 3), -1, 1); } return a(++$depth, str_repeat("a", 1000)); } var_dump(a());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 17
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/9uKDe
function name:  (null)
number of ops:  23
compiled vars:  !0 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <false>, ->17
    4     1    >   INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAL                                                 '8.0.0'
          4        DO_ICALL                                         $1      
          5        ASSIGN                                                   !0, $1
    6     6        INIT_FCALL                                               'define'
          7        SEND_VAL                                                 'PHP_VERSION_ID'
          8        FETCH_DIM_R                                      ~3      !0, 0
          9        MUL                                              ~4      ~3, 10000
         10        FETCH_DIM_R                                      ~5      !0, 1
         11        MUL                                              ~6      ~5, 100
         12        ADD                                              ~7      ~4, ~6
         13        FETCH_DIM_R                                      ~8      !0, 2
         14        ADD                                              ~9      ~7, ~8
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                                 
   32    17    >   INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'a'
         19        DO_FCALL                                      0  $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 65
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 36
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 52
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9uKDe
function name:  a
number of ops:  76
compiled vars:  !0 = $depth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      0
   12     1        IS_IDENTICAL                                             !0, 1000
          2      > JMPZ                                                     ~1, ->65
   14     3    > > JMPZ                                                     <true>, ->20
   15     4    >   INIT_FCALL                                               'array_slice'
          5        INIT_FCALL                                               'array_slice'
          6        INIT_FCALL                                               'debug_backtrace'
          7        SEND_VAL                                                 -4
          8        SEND_VAL                                                 3
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 3
         13        DO_ICALL                                         $3      
         14        SEND_VAR                                                 $3
         15        SEND_VAL                                                 -1
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $4      
         18      > RETURN                                                   $4
         19*       JMP                                                      ->65
   18    20    > > JMPZ                                                     <true>, ->36
   19    21    >   INIT_FCALL                                               'array_slice'
         22        INIT_FCALL                                               'array_slice'
         23        INIT_FCALL                                               'debug_backtrace'
         24        SEND_VAL                                                 -2
         25        DO_ICALL                                         $5      
         26        SEND_VAR                                                 $5
         27        SEND_VAL                                                 0
         28        SEND_VAL                                                 3
         29        DO_ICALL                                         $6      
         30        SEND_VAR                                                 $6
         31        SEND_VAL                                                 -1
         32        SEND_VAL                                                 1
         33        DO_ICALL                                         $7      
         34      > RETURN                                                   $7
         35*       JMP                                                      ->65
   22    36    > > JMPZ                                                     <true>, ->52
   23    37    >   INIT_FCALL                                               'array_slice'
         38        INIT_FCALL                                               'array_slice'
         39        INIT_FCALL                                               'debug_backtrace'
         40        SEND_VAL                                                 <false>
         41        DO_ICALL                                         $8      
         42        SEND_VAR                                                 $8
         43        SEND_VAL                                                 0
         44        SEND_VAL                                                 3
         45        DO_ICALL                                         $9      
         46        SEND_VAR                                                 $9
         47        SEND_VAL                                                 -1
         48        SEND_VAL                                                 1
         49        DO_ICALL                                         $10     
         50      > RETURN                                                   $10
         51*       JMP                                                      ->65
   26    52    >   INIT_FCALL                                               'array_slice'
         53        INIT_FCALL                                               'array_slice'
         54        INIT_FCALL                                               'debug_backtrace'
         55        DO_ICALL                                         $11     
         56        SEND_VAR                                                 $11
         57        SEND_VAL                                                 0
         58        SEND_VAL                                                 3
         59        DO_ICALL                                         $12     
         60        SEND_VAR                                                 $12
         61        SEND_VAL                                                 -1
         62        SEND_VAL                                                 1
         63        DO_ICALL                                         $13     
         64      > RETURN                                                   $13
   29    65    >   INIT_FCALL_BY_NAME                                       'a'
         66        PRE_INC                                          ~14     !0
         67        SEND_VAL_EX                                              ~14
         68        INIT_FCALL                                               'str_repeat'
         69        SEND_VAL                                                 'a'
         70        SEND_VAL                                                 1000
         71        DO_ICALL                                         $15     
         72        SEND_VAR_NO_REF_EX                                       $15
         73        DO_FCALL                                      0  $16     
         74      > RETURN                                                   $16
   30    75*     > RETURN                                                   null

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.55 ms | 1398 KiB | 26 Q