3v4l.org

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

Function exception_error_handler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/mjQqq
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
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    3     4        NEW                                              $4      'ErrorException'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
    4     8*     > RETURN                                                   null

End of function exception_error_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.98 ms | 1396 KiB | 19 Q