3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foobar { public function a($method, $parameters) { if (in_array($method, ['foo', 'bar'])) { return $this->$method($parameters); } return call_user_func_array(array($query, $method), $parameters); } public function dump(...$params) { return var_dump($params); } public function foo(...$params) { return in_array('foobar', $params); } public function bar(...$params) { return in_array('barfoo', $params); } } $foobar = new Foobar; echo $foobar->foo('foobar', 'test', 'hello');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maiCd
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foobar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'Foobar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   32     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        SEND_VAL_EX                                              'foobar'
          5        SEND_VAL_EX                                              'test'
          6        SEND_VAL_EX                                              'hello'
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

Class Foobar:
Function a:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maiCd
function name:  a
number of ops:  16
compiled vars:  !0 = $method, !1 = $parameters, !2 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        IN_ARRAY                                                 !0, <array>
          3      > JMPZ                                                     ~3, ->8
    9     4    >   INIT_METHOD_CALL                                         !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
   12     8    >   INIT_ARRAY                                       ~5      !2
          9        ADD_ARRAY_ELEMENT                                ~5      !0
         10        INIT_USER_CALL                                0          'call_user_func_array', ~5
         11        SEND_ARRAY                                               !1
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      0  $6      
         14      > RETURN                                                   $6
   13    15*     > RETURN                                                   null

End of function a

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maiCd
function name:  dump
number of ops:  6
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_VARIADIC                                    !0      
   17     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   18     5*     > RETURN                                                   null

End of function dump

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maiCd
function name:  foo
number of ops:  7
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV_VARIADIC                                    !0      
   22     1        INIT_FCALL                                               'in_array'
          2        SEND_VAL                                                 'foobar'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   23     6*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maiCd
function name:  bar
number of ops:  7
compiled vars:  !0 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV_VARIADIC                                    !0      
   27     1        INIT_FCALL                                               'in_array'
          2        SEND_VAL                                                 'barfoo'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   28     6*     > RETURN                                                   null

End of function bar

End of class Foobar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.9 ms | 1400 KiB | 17 Q