3v4l.org

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

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pEgZY
function name:  f
number of ops:  11
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $args
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        FUNC_GET_ARGS                                    ~5      
          5        ASSIGN                                                   !4, ~5
    4     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !4
          8        DO_ICALL                                                 
    5     9      > RETURN                                                   <true>
    6    10*     > 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/pEgZY
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
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    9     4        NEW                                              $4      'ErrorException'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
   10     8*     > RETURN                                                   null

End of function exception_error_handler

Function %00%7Bclosure%7D%2Fin%2FpEgZY%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pEgZY
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   15     4        FUNC_GET_ARGS                                    ~5      
          5        ASSIGN                                                   !4, ~5
   16     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !4
          8        DO_ICALL                                                 
   17     9      > RETURN                                                   <true>
   18    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpEgZY%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.52 ms | 1404 KiB | 21 Q