3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($errno, $errstr, $errfile, $errline ) { echo $errno, ": ", $errstr, " in ", $errfile, " on ", $errline, "\n"; return true; } function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr); } ++$lorem; set_error_handler('f'); ++$ipsum; /* set_error_handler(function ($errno, $errstr, $errfile, $errline) { echo $errno, ": ", $errstr, " in ", $errfile, " on ", $errline, "\n"; return true; }); ++$dolor; */ set_error_handler("exception_error_handler"); try { preg_match("/foo(+/", null); echo "+valid\n"; } catch (ErrorException $e) { echo "-fail: ", $e->getMessage(), "\n"; } restore_error_handler(); /* ++$sit; restore_error_handler(); */ ++$amet; restore_error_handler(); ++$consectepture;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XIc7s
function name:  (null)
number of ops:  27
compiled vars:  !0 = $lorem, !1 = $ipsum, !2 = $e, !3 = $amet, !4 = $consectepture
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   PRE_INC                                                  !0
   13     1        INIT_FCALL                                               'set_error_handler'
          2        SEND_VAL                                                 'f'
          3        DO_ICALL                                                 
   15     4        PRE_INC                                                  !1
   26     5        INIT_FCALL                                               'set_error_handler'
          6        SEND_VAL                                                 'exception_error_handler'
          7        DO_ICALL                                                 
   28     8        INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%2Ffoo%28%2B%2F'
         10        SEND_VAL                                                 null
         11        DO_ICALL                                                 
   29    12        ECHO                                                     '%2Bvalid%0A'
         13      > JMP                                                      ->20
   31    14  E > > CATCH                                       last         'ErrorException'
   32    15    >   ECHO                                                     '-fail%3A+'
         16        INIT_METHOD_CALL                                         !2, 'getMessage'
         17        DO_FCALL                                      0  $10     
         18        ECHO                                                     $10
         19        ECHO                                                     '%0A'
   34    20    >   INIT_FCALL                                               'restore_error_handler'
         21        DO_ICALL                                                 
   42    22        PRE_INC                                                  !3
   44    23        INIT_FCALL                                               'restore_error_handler'
         24        DO_ICALL                                                 
   46    25        PRE_INC                                                  !4
         26      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XIc7s
function name:  f
number of ops:  14
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    3     4        ECHO                                                     !0
          5        ECHO                                                     '%3A+'
          6        ECHO                                                     !1
          7        ECHO                                                     '+in+'
          8        ECHO                                                     !2
          9        ECHO                                                     '+on+'
         10        ECHO                                                     !3
         11        ECHO                                                     '%0A'
    4    12      > RETURN                                                   <true>
    5    13*     > RETURN                                                   null

End of function f

Function exception_error_handler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/XIc7s
function name:  exception_error_handler
number of ops:  9
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    8     4        NEW                                              $4      'ErrorException'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
    9     8*     > RETURN                                                   null

End of function exception_error_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.32 ms | 1392 KiB | 19 Q