3v4l.org

run code in 300+ PHP versions simultaneously
<?php function onDie(){ $message = ob_get_contents(); //Capture 'Doh' ob_end_clean(); //Cleans output buffer callWhateverYouWhant(); } register_shutdown_function('onDie'); //... ob_start(); //You need this to Turn on output buffering before using die/exit @$dumbVar = 1000/0 or die('Doh'); //"@" prevent warning/error from php //... ob_end_clean(); //Remember clean your buffer before you need to use echo/print
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdJYD
function name:  (null)
number of ops:  15
compiled vars:  !0 = $dumbVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'register_shutdown_function'
          1        SEND_VAL                                                 'onDie'
          2        DO_ICALL                                                 
   10     3        INIT_FCALL                                               'ob_start'
          4        DO_ICALL                                                 
   11     5        BEGIN_SILENCE                                    ~3      
          6        DIV                                              ~4      1000, 0
          7        ASSIGN                                           ~5      !0, ~4
          8        END_SILENCE                                              ~3
          9      > JMPNZ_EX                                         ~5      ~5, ->12
         10    > > EXIT                                                     'Doh'
         11*       BOOL                                             ~5      <true>
   13    12    >   INIT_FCALL                                               'ob_end_clean'
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function ondie:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdJYD
function name:  onDie
number of ops:  8
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'ob_get_contents'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
    5     3        INIT_FCALL                                               'ob_end_clean'
          4        DO_ICALL                                                 
    6     5        INIT_FCALL_BY_NAME                                       'callWhateverYouWhant'
          6        DO_FCALL                                      0          
    7     7      > RETURN                                                   null

End of function ondie

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.24 ms | 1395 KiB | 21 Q