3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(0); @ini_set('display_errors', 0); if (!function_exists('shutdown')) { function shutdown() { $isError = false; if ($error = error_get_last()){ switch($error['type']){ case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: $isError = true; break; } } if ($isError){ echo preg_replace('/(<\?php)(.*?)(\?>)/ims','',$GLOBALS['html']); // Run even next lines!!! //eval(str_replace('eval(','//eval(',file_get_contents(__FILE__))); return true; } } } register_shutdown_function('shutdown'); $html='Hi it is <b>PAPION</b>. Now timestamp is <?php echo time(); ?>. have a good time. a can be: <?php a=b*2 ?>. and wrong timestamp is <?php xxxxtime(); ?>.'; $html = preg_replace_callback('/(<\?php)(.*?)(\?>)/ims',function($matches){ try { ob_start(); eval($matches[2]); return ob_get_clean(); } catch(Throwable $e) { return ""; } }, $html); echo $html; echo "\n\nwe are here!";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/0R7dq
function name:  (null)
number of ops:  29
compiled vars:  !0 = $html
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     0
          2        DO_ICALL                                                     
    3     3        BEGIN_SILENCE                                        ~2      
          4        INIT_FCALL                                                   'ini_set'
          5        SEND_VAL                                                     'display_errors'
          6        SEND_VAL                                                     0
          7        DO_ICALL                                                     
          8        END_SILENCE                                                  ~2
    4     9        INIT_FCALL                                                   'function_exists'
         10        SEND_VAL                                                     'shutdown'
         11        DO_ICALL                                             $4      
         12        BOOL_NOT                                             ~5      $4
         13      > JMPZ                                                         ~5, ->15
    5    14    >   DECLARE_FUNCTION                                             'shutdown'
   25    15    >   INIT_FCALL                                                   'register_shutdown_function'
         16        SEND_VAL                                                     'shutdown'
         17        DO_ICALL                                                     
   26    18        ASSIGN                                                       !0, 'Hi+it+is+%3Cb%3EPAPION%3C%2Fb%3E.+Now+timestamp+is+%3C%3Fphp+echo+time%28%29%3B+%3F%3E.+have+a+good+time.+a+can+be%3A+%3C%3Fphp+a%3Db%2A2+%3F%3E.+and+wrong+timestamp+is+%3C%3Fphp+xxxxtime%28%29%3B+%3F%3E.'
   27    19        INIT_FCALL                                                   'preg_replace_callback'
         20        SEND_VAL                                                     '%2F%28%3C%5C%3Fphp%29%28.%2A%3F%29%28%5C%3F%3E%29%2Fims'
         21        DECLARE_LAMBDA_FUNCTION                              ~8      [1]
   35    22        SEND_VAL                                                     ~8
         23        SEND_VAR                                                     !0
   27    24        DO_ICALL                                             $9      
         25        ASSIGN                                                       !0, $9
   36    26        ECHO                                                         !0
   37    27        ECHO                                                         '%0A%0Awe+are+here%21'
         28      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 15
Branch analysis from position: 15
Branch analysis from position: 15
Branch analysis from position: 18
filename:       /in/0R7dq
function name:  shutdown
number of ops:  25
compiled vars:  !0 = $isError, !1 = $error
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                       !0, <false>
    7     1        INIT_FCALL                                                   'error_get_last'
          2        DO_ICALL                                             $3      
          3        ASSIGN                                               ~4      !1, $3
          4      > JMPZ                                                         ~4, ->18
    8     5    >   FETCH_DIM_R                                          ~5      !1, 'type'
          6        CASE                                                         ~5, 1
          7      > JMPNZ                                                        ~6, ->15
          8    >   CASE                                                         ~5, 16
          9      > JMPNZ                                                        ~6, ->15
         10    >   CASE                                                         ~5, 64
         11      > JMPNZ                                                        ~6, ->15
         12    >   CASE                                                         ~5, 256
         13      > JMPNZ                                                        ~6, ->15
         14    > > JMP                                                          ->17
   13    15    >   ASSIGN                                                       !0, <true>
   14    16      > JMP                                                          ->17
         17    >   FREE                                                         ~5
   17    18    > > JMPZ                                                         !0, ->24
   18    19    >   FETCH_R                          global              ~8      'html'
         20        FRAMELESS_ICALL_3                preg_replace        ~9      '%2F%28%3C%5C%3Fphp%29%28.%2A%3F%29%28%5C%3F%3E%29%2Fims', ''
         21        OP_DATA                                                      ~8
         22        ECHO                                                         ~9
   21    23      > RETURN                                                       <true>
   23    24    > > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0R7dq
function name:  {closure:/in/0R7dq:27}
number of ops:  12
compiled vars:  !0 = $matches, !1 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   27     0  E >   RECV                                                 !0      
   29     1        INIT_FCALL                                                   'ob_start'
          2        DO_ICALL                                                     
   30     3        FETCH_DIM_R                                          ~3      !0, 2
          4        INCLUDE_OR_EVAL                                              ~3, EVAL
   31     5        INIT_FCALL                                                   'ob_get_clean'
          6        DO_ICALL                                             $5      
          7      > RETURN                                                       $5
          8*       JMP                                                          ->11
   32     9  E > > CATCH                                           last         'Throwable'
   33    10    > > RETURN                                                       ''
   35    11*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.87 ms | 2116 KiB | 21 Q