3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); // assume ob_level is set to 1 $GLOBALS['test'] = false; // is used too check if output is called before test is set to true function output_check() { if($GLOBALS['test'] === true) return; // this is called before test is set to true, there's no return echo "This will be echoed before 'duck': "; die(); // this will end the execution after echoeing duck echo "This will not be echoed, yet 'duck' will be."; } header_register_callback("output_check"); ob_end_clean(); echo "duck"; $GLOBALS['test'] = true; echo " and ducklings";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5A8tf
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'ob_start'
          1        DO_ICALL                                                 
    4     2        FETCH_W                      global              $1      'test'
          3        ASSIGN                                                   $1, <false>
   13     4        INIT_FCALL                                               'header_register_callback'
          5        SEND_VAL                                                 'output_check'
          6        DO_ICALL                                                 
   15     7        INIT_FCALL                                               'ob_end_clean'
          8        DO_ICALL                                                 
   16     9        ECHO                                                     'duck'
   17    10        FETCH_W                      global              $5      'test'
         11        ASSIGN                                                   $5, <true>
   18    12        ECHO                                                     '+and+ducklings'
         13      > RETURN                                                   1

Function output_check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/5A8tf
function name:  output_check
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_R                      global              ~0      'test'
          1        TYPE_CHECK                                    8          ~0
          2      > JMPZ                                                     ~1, ->4
          3    > > RETURN                                                   null
    9     4    >   ECHO                                                     'This+will+be+echoed+before+%27duck%27%3A+'
   10     5      > EXIT                                                     
   11     6*       ECHO                                                     'This+will+not+be+echoed%2C+yet+%27duck%27+will+be.'
   12     7*     > RETURN                                                   null

End of function output_check

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.75 ms | 1007 KiB | 16 Q