3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ciao() { $out = '<pre>'; $args = func_get_args(); if(!empty($args)) { // var_export() causes fatal errors on recursion... ob_start(); ini_set('xdebug.var_display_max_depth', 4); var_dump($args); $out .= ob_get_contents()."\n\n"; ob_end_clean(); } $out .= get_backtrace(1); die($out); } class A { function B() { while (ob_get_level() > 1) ob_end_flush(); // store possible trailing content $content = ob_get_clean(); // start an output buffer which cannot be flushed (3rd parameter is false) // callback function get all output and corrects Content-Length header ob_start(function($buffer) { ciao($buffer); }, 0, false); } } $a = new A; $a->B();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O35ZA
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   43     3        INIT_METHOD_CALL                                         !0, 'B'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function ciao:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 21
filename:       /in/O35ZA
function name:  ciao
number of ops:  27
compiled vars:  !0 = $out, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%3Cpre%3E'
    7     1        FUNC_GET_ARGS                                    ~3      
          2        ASSIGN                                                   !1, ~3
    8     3        ISSET_ISEMPTY_CV                                 ~5      !1
          4        BOOL_NOT                                         ~6      ~5
          5      > JMPZ                                                     ~6, ->21
   12     6    >   INIT_FCALL                                               'ob_start'
          7        DO_ICALL                                                 
   13     8        INIT_FCALL                                               'ini_set'
          9        SEND_VAL                                                 'xdebug.var_display_max_depth'
         10        SEND_VAL                                                 4
         11        DO_ICALL                                                 
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   15    15        INIT_FCALL                                               'ob_get_contents'
         16        DO_ICALL                                         $10     
         17        CONCAT                                           ~11     $10, '%0A%0A'
         18        ASSIGN_OP                                     8          !0, ~11
   16    19        INIT_FCALL                                               'ob_end_clean'
         20        DO_ICALL                                                 
   19    21    >   INIT_FCALL_BY_NAME                                       'get_backtrace'
         22        SEND_VAL_EX                                              1
         23        DO_FCALL                                      0  $14     
         24        ASSIGN_OP                                     8          !0, $14
   21    25      > EXIT                                                     !0
   22    26*     > RETURN                                                   null

End of function ciao

Function %00%7Bclosure%7D%2Fin%2FO35ZA%3A36%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O35ZA
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $buffer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
   37     1        INIT_FCALL                                               'ciao'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   38     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FO35ZA%3A36%240

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 1
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 1
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 1
Branch analysis from position: 7
Branch analysis from position: 1
filename:       /in/O35ZA
function name:  B
number of ops:  17
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > JMP                                                      ->3
   29     1    >   INIT_FCALL                                               'ob_end_flush'
          2        DO_ICALL                                                 
   28     3    >   INIT_FCALL                                               'ob_get_level'
          4        DO_ICALL                                         $2      
          5        IS_SMALLER                                               1, $2
          6      > JMPNZ                                                    ~3, ->1
   32     7    >   INIT_FCALL                                               'ob_get_clean'
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
   36    10        INIT_FCALL                                               'ob_start'
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FO35ZA%3A36%240'
   38    12        SEND_VAL                                                 ~6
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 <false>
         15        DO_ICALL                                                 
   39    16      > RETURN                                                   null

End of function b

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.73 ms | 1403 KiB | 30 Q