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 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 19
Branch analysis from position: 19
2 jumps found. (Code = 107) Position 1 = 20, Position 2 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/08JkW
function name:  (null)
number of ops:  35
compiled vars:  !0 = $lorem, !1 = $ipsum, !2 = $dolor, !3 = $e, !4 = $sit, !5 = $amet, !6 = $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
   17     5        INIT_FCALL                                               'set_error_handler'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F08JkW%3A17%240'
   20     7        SEND_VAL                                                 ~10
          8        DO_ICALL                                                 
   22     9        PRE_INC                                                  !2
   24    10        INIT_FCALL                                               'set_error_handler'
         11        SEND_VAL                                                 'exception_error_handler'
         12        DO_ICALL                                                 
   26    13        INIT_FCALL                                               'preg_match'
         14        SEND_VAL                                                 '%2Ffoo%28%2B%2F'
         15        SEND_VAL                                                 null
         16        DO_ICALL                                                 
   27    17        ECHO                                                     '%2Bvalid%0A'
         18      > JMP                                                      ->25
   29    19  E > > CATCH                                       last         'ErrorException'
   30    20    >   ECHO                                                     '-fail%3A+'
         21        INIT_METHOD_CALL                                         !3, 'getMessage'
         22        DO_FCALL                                      0  $15     
         23        ECHO                                                     $15
         24        ECHO                                                     '%0A'
   32    25    >   INIT_FCALL                                               'restore_error_handler'
         26        DO_ICALL                                                 
   34    27        PRE_INC                                                  !4
   36    28        INIT_FCALL                                               'restore_error_handler'
         29        DO_ICALL                                                 
   38    30        PRE_INC                                                  !5
   40    31        INIT_FCALL                                               'restore_error_handler'
         32        DO_ICALL                                                 
   42    33        PRE_INC                                                  !6
         34      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/08JkW
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/08JkW
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

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

End of function %00%7Bclosure%7D%2Fin%2F08JkW%3A17%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
199.05 ms | 1400 KiB | 19 Q