3v4l.org

run code in 300+ PHP versions simultaneously
<?php function onDie(){ $message = ob_get_contents(); //Capture 'Doh' ob_end_clean(); //Cleans output buffer echo 'ondie'.$message; //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 echo 'asdfsdfd';
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/YM1jb
function name:  (null)
number of ops:  16
compiled vars:  !0 = $dumbVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'register_shutdown_function'
          1        SEND_VAL                                                 'onDie'
          2        DO_ICALL                                                 
   12     3        INIT_FCALL                                               'ob_start'
          4        DO_ICALL                                                 
   13     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>
   15    12    >   INIT_FCALL                                               'ob_end_clean'
         13        DO_ICALL                                                 
   17    14        ECHO                                                     'asdfsdfd'
         15      > RETURN                                                   1

Function ondie:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YM1jb
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                                                 
    7     5        CONCAT                                           ~4      'ondie', !0
          6        ECHO                                                     ~4
    9     7      > RETURN                                                   null

End of function ondie

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.2 ms | 1395 KiB | 21 Q