3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fn = function() { throw new Exception('test'); }; try { $fn(); } catch (Exception $e) { foreach ($e->getTrace() as $frame) { $r = new ReflectionFunction($frame['function']); echo($r->isClosure()); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/VJmLA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $fn, !1 = $e, !2 = $frame, !3 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVJmLA%3A3%240'
          1        ASSIGN                                                   !0, ~4
    6     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->21
    7     5  E > > CATCH                                       last         'Exception'
    8     6    >   INIT_METHOD_CALL                                         !1, 'getTrace'
          7        DO_FCALL                                      0  $7      
          8      > FE_RESET_R                                       $8      $7, ->20
          9    > > FE_FETCH_R                                               $8, !2, ->20
    9    10    >   NEW                                              $9      'ReflectionFunction'
         11        CHECK_FUNC_ARG                                           
         12        FETCH_DIM_FUNC_ARG                               $10     !2, 'function'
         13        SEND_FUNC_ARG                                            $10
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $9
   10    16        INIT_METHOD_CALL                                         !3, 'isClosure'
         17        DO_FCALL                                      0  $13     
         18        ECHO                                                     $13
    8    19      > JMP                                                      ->9
         20    >   FE_FREE                                                  $8
   12    21    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVJmLA%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/VJmLA
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVJmLA%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.66 ms | 1395 KiB | 13 Q