3v4l.org

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

Class Wl\A\B:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LW4UO
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.

Class Wl\A\A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LW4UO
function name:  b
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     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          
   13     7      > RETURN                                                   null

End of function b

End of class Wl\A\A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1400 KiB | 17 Q