3v4l.org

run code in 300+ PHP versions simultaneously
<?php $buffer = -1; function callback($output) { global $buffer; $buffer = $output; return $output; } ob_start('callback'); echo 'hello'; $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/k3LCs
function name:  (null)
number of ops:  15
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                                               'ob_get_contents'
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
   14     8        INIT_FCALL                                               'ob_get_clean'
          9        DO_ICALL                                                 
   15    10        ECHO                                                     !1
   16    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k3LCs
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                                                   !0
    9     4*     > RETURN                                                   null

End of function callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.84 ms | 1395 KiB | 21 Q