3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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_filter(array_slice(debug_backtrace(false, 3), 0, 3)), -1, 1); } return array_slice(array_filter(array_slice(debug_backtrace(false), 0, 3)), -1, 1); } return a(++$depth, str_repeat("a", 1000)); } var_dump(a());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5ofM2
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'a'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

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

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.58 ms | 1403 KiB | 24 Q