3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(Closure $test) { try { $test(); } catch (Throwable $e) { var_dump([get_class($e) => $e->getMessage()]); echo 'catch!', PHP_EOL; } } test(function () { include __DIR__ . '/a.php'; }); test(function () { require __DIR__ . '/b.php'; }); echo 'done.' . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Y1rf
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'test'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8Y1rf%3A12%240'
          2        SEND_VAL                                                 ~0
          3        DO_FCALL                                      0          
   13     4        INIT_FCALL                                               'test'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8Y1rf%3A13%241'
          6        SEND_VAL                                                 ~2
          7        DO_FCALL                                      0          
   14     8        ECHO                                                     'done.%0A'
   15     9      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Y1rf
function name:  test
number of ops:  15
compiled vars:  !0 = $test, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->14
    6     4  E > > CATCH                                       last         'Throwable'
    7     5    >   INIT_FCALL                                               'var_dump'
          6        GET_CLASS                                        ~3      !1
          7        INIT_METHOD_CALL                                         !1, 'getMessage'
          8        DO_FCALL                                      0  $4      
          9        INIT_ARRAY                                       ~5      $4, ~3
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
    8    12        ECHO                                                     'catch%21'
         13        ECHO                                                     '%0A'
   10    14    > > RETURN                                                   null

End of function test

Function %00%7Bclosure%7D%2Fin%2F8Y1rf%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Y1rf
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INCLUDE_OR_EVAL                                          '%2Fin%2Fa.php', INCLUDE
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8Y1rf%3A12%240

Function %00%7Bclosure%7D%2Fin%2F8Y1rf%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Y1rf
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INCLUDE_OR_EVAL                                          '%2Fin%2Fb.php', REQUIRE
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8Y1rf%3A13%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.38 ms | 1403 KiB | 17 Q