3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Wl\A; class B { public function get() { return "BBBBB"; } } $b = new B(); $funct = function (B $b) { print_r($b::get()); }; $closure = &$funct; $reflection = new \ReflectionFunction($closure); $arguments = $reflection->getParameters(); echo "ARGS:\n"; var_dump($arguments); exit; try { $a->b(""); } catch (\Exception $e) { echo "catched"; } catch (\TypeError $e) { echo "subidubi"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
Found catch point at position: 22
Branch analysis from position: 22
2 jumps found. (Code = 107) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 25
Branch analysis from position: 25
filename:       /in/O6C3W
function name:  (null)
number of ops:  28
compiled vars:  !0 = $b, !1 = $funct, !2 = $closure, !3 = $reflection, !4 = $arguments, !5 = $a, !6 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $7      'Wl%5CA%5CB'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $7
   12     3        DECLARE_LAMBDA_FUNCTION                                  '%00wl%5Ca%5C%7Bclosure%7D%2Fin%2FO6C3W%3A12%240'
          4        ASSIGN                                                   !1, ~10
   14     5        ASSIGN_REF                                               !2, !1
   15     6        NEW                                              $13     'ReflectionFunction'
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $13
   16    10        INIT_METHOD_CALL                                         !3, 'getParameters'
         11        DO_FCALL                                      0  $16     
         12        ASSIGN                                                   !4, $16
   17    13        ECHO                                                     'ARGS%3A%0A'
   18    14        INIT_NS_FCALL_BY_NAME                                    'Wl%5CA%5Cvar_dump'
         15        SEND_VAR_EX                                              !4
         16        DO_FCALL                                      0          
   19    17      > EXIT                                                     
   21    18*       INIT_METHOD_CALL                                         !5, 'b'
         19*       SEND_VAL_EX                                              ''
         20*       DO_FCALL                                      0          
         21*       JMP                                                      ->27
   22    22  E > > CATCH                                                    'Exception', ->25
   23    23    >   ECHO                                                     'catched'
         24      > JMP                                                      ->27
   24    25  E > > CATCH                                       last         'TypeError'
   25    26    >   ECHO                                                     'subidubi'
   26    27    > > RETURN                                                   1

Function %00wl%5Ca%5C%7Bclosure%7D%2Fin%2FO6C3W%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O6C3W
function name:  Wl\A\{closure}
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        INIT_NS_FCALL_BY_NAME                                    'Wl%5CA%5Cprint_r'
          2        FETCH_CLASS                                   0  $1      !0
          3        INIT_STATIC_METHOD_CALL                                  $1, 'get'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
          7      > RETURN                                                   null

End of function %00wl%5Ca%5C%7Bclosure%7D%2Fin%2FO6C3W%3A12%240

Class Wl\A\B:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O6C3W
function name:  get
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'BBBBB'
    7     1*     > RETURN                                                   null

End of function get

End of class Wl\A\B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.74 ms | 1400 KiB | 17 Q