3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call(array &$class, string $member, ...$args) { if(!isset($args[1])) { if(!isset($class[$member])) exit($member.' is not a member of the class.'); else { if(!is_callable($class[$member])) return $class[$member]; } } else { } } $Foo = [ 'bar' => 'Hello World' ]; echo(call($Foo, 'bar'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qEQ3g
function name:  (null)
number of ops:  7
compiled vars:  !0 = $Foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL                                               'call'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'bar'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/qEQ3g
function name:  call
number of ops:  22
compiled vars:  !0 = $class, !1 = $member, !2 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_VARIADIC                                    !2      
    3     3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !2, 1
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->21
    4     6    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !0, !1
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ                                                     ~6, ->12
          9    >   CONCAT                                           ~7      !1, '+is+not+a+member+of+the+class.'
         10      > EXIT                                                     ~7
         11*       JMP                                                      ->20
    6    12    >   INIT_FCALL                                               'is_callable'
         13        FETCH_DIM_R                                      ~8      !0, !1
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                         $9      
         16        BOOL_NOT                                         ~10     $9
         17      > JMPZ                                                     ~10, ->20
         18    >   FETCH_DIM_R                                      ~11     !0, !1
         19      > RETURN                                                   ~11
         20    > > JMP                                                      ->21
   12    21    > > RETURN                                                   null

End of function call

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.95 ms | 1399 KiB | 16 Q