3v4l.org

run code in 300+ PHP versions simultaneously
<?php $buffer = -1; function callback($output) { global $buffer; $buffer = $output; return 'R'; } ob_start('callback'); echo 'hello'; $a = ob_get_contents(); $b = ob_get_clean(); echo $a; echo $b; var_dump($buffer);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oOO0W
function name:  (null)
number of ops:  17
compiled vars:  !0 = $buffer, !1 = $a, !2 = $b
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                                               'ob_get_contents'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
   14     8        INIT_FCALL                                               'ob_get_clean'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
   15    11        ECHO                                                     !1
   16    12        ECHO                                                     !2
   17    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oOO0W
function name:  callback
number of ops:  5
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      > RETURN                                                   'R'
    9     4*     > RETURN                                                   null

End of function callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.83 ms | 1387 KiB | 21 Q