3v4l.org

run code in 300+ PHP versions simultaneously
<?php $buffer = -1; function callback($output) { global $buffer; $buffer = $output; return $output.'r'; } ob_start('callback'); echo 'hello'; print_r(ob_get_status()); $a = ob_get_contents(); ob_get_clean(); echo $a; var_dump($buffer);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fDviZ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $buffer, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, -1
   11     1        INIT_FCALL                                               'ob_start'
          2        SEND_VAL                                                 'callback'
          3        DO_ICALL                                                 
   12     4        ECHO                                                     'hello'
   13     5        INIT_FCALL                                               'print_r'
          6        INIT_FCALL                                               'ob_get_status'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'ob_get_contents'
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
   15    13        INIT_FCALL                                               'ob_get_clean'
         14        DO_ICALL                                                 
   16    15        ECHO                                                     !1
   17    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fDviZ
function name:  callback
number of ops:  6
compiled vars:  !0 = $output, !1 = $buffer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        BIND_GLOBAL                                              !1, 'buffer'
    7     2        ASSIGN                                                   !1, !0
    8     3        CONCAT                                           ~3      !0, 'r'
          4      > RETURN                                                   ~3
    9     5*     > RETURN                                                   null

End of function callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.47 ms | 1395 KiB | 25 Q