3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo($foo) { echo "Executing foo\n"; } set_error_handler(function($errno, $errstr) { $errors = array_filter(array_keys(get_defined_constants()), function($v) { return strncmp($v, "E_", 2) == 0; }); $errors = array_combine($errors, array_map("constant", $errors)); throw new Exception(array_search($errno, $errors) . ": " . $errstr); }); try { foo(); } catch (Exception $e) { echo $e->getMessage(), "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haASA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                                   'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
   11     2        SEND_VAL                                                     ~1
    7     3        DO_ICALL                                                     
   14     4        INIT_FCALL                                                   'foo'
          5        DO_FCALL                                          0          
          6      > JMP                                                          ->12
   15     7  E > > CATCH                                           last         'Exception'
   16     8    >   INIT_METHOD_CALL                                             !0, 'getMessage'
          9        DO_FCALL                                          0  $4      
         10        ECHO                                                         $4
         11        ECHO                                                         '%0A'
   17    12    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/haASA
function name:  {closure:/in/haASA:7}
number of ops:  33
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errors
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    8     2        INIT_FCALL                                                   'array_filter'
          3        INIT_FCALL                                                   'array_keys'
          4        INIT_FCALL                                                   'get_defined_constants'
          5        DO_ICALL                                             $3      
          6        SEND_VAR                                                     $3
          7        DO_ICALL                                             $4      
          8        SEND_VAR                                                     $4
          9        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
         10        SEND_VAL                                                     ~5
         11        DO_ICALL                                             $6      
         12        ASSIGN                                                       !2, $6
    9    13        INIT_FCALL                                                   'array_combine'
         14        SEND_VAR                                                     !2
         15        INIT_FCALL                                                   'array_map'
         16        SEND_VAL                                                     'constant'
         17        SEND_VAR                                                     !2
         18        DO_ICALL                                             $8      
         19        SEND_VAR                                                     $8
         20        DO_ICALL                                             $9      
         21        ASSIGN                                                       !2, $9
   10    22        NEW                                                  $11     'Exception'
         23        INIT_FCALL                                                   'array_search'
         24        SEND_VAR                                                     !0
         25        SEND_VAR                                                     !2
         26        DO_ICALL                                             $12     
         27        CONCAT                                               ~13     $12, '%3A+'
         28        CONCAT                                               ~14     ~13, !1
         29        SEND_VAL_EX                                                  ~14
         30        DO_FCALL                                          0          
         31      > THROW                                             0          $11
   11    32*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haASA
function name:  {closure:{closure:/in/haASA:7}:8}
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'strncmp'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     'E_'
          4        SEND_VAL                                                     2
          5        DO_ICALL                                             $1      
          6        IS_EQUAL                                             ~2      $1, 0
          7      > RETURN                                                       ~2
          8*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haASA
function name:  foo
number of ops:  3
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ECHO                                                         'Executing+foo%0A'
    5     2      > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
212.32 ms | 2939 KiB | 22 Q