3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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"; }
based on mjZma
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
Found catch point at position: 21
Branch analysis from position: 21
2 jumps found. (Code = 107) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 107) Position 1 = 25, Position 2 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 24
Branch analysis from position: 24
filename:       /in/LW4UO
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $reflection, !2 = $closure, !3 = $arguments, !4 = $e
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
  10     1        NOP                                                      
  16     2        NEW                                              $7      :-5
         3        DO_FCALL                                      0          
         4        ASSIGN                                                   !0, $7
  18     5        NEW                                              $10     :-3
         6        SEND_VAR_EX                                              !2
         7        DO_FCALL                                      0          
         8        ASSIGN                                                   !1, $10
  19     9        INIT_METHOD_CALL                                         !1, 'getParameters'
        10        DO_FCALL                                      0  $13     
        11        ASSIGN                                                   !3, $13
  20    12        ECHO                                                     'ARGS%3A%0A'
  21    13        INIT_NS_FCALL_BY_NAME                                    'Wl%5CA%5Cvar_dump'
        14        SEND_VAR_EX                                              !3
        15        DO_FCALL                                      0          
  22    16      > EXIT                                                     
  24    17*       INIT_METHOD_CALL                                         !0, 'b'
        18*       SEND_VAL_EX                                              ''
        19*       DO_FCALL                                      0          
        20*       JMP                                                      ->26
  25    21  E > > CATCH                                                    'Exception', !4, ->24
  26    22    >   ECHO                                                     'catched'
        23      > JMP                                                      ->26
  27    24  E > > CATCH                                                    'TypeError', !4
  28    25    >   ECHO                                                     'subidubi'
  29    26    > > 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                                 512  :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 7.3.0