3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected function bar() { return implode(' ', func_get_args()); } public function __call($method, $args) { array_unshift($args, $method); return $this->bar(...$args); } } echo (new Foo)->this('is','an','example','of','variadics');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J0GLP
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'this'
          3        SEND_VAL_EX                                              'is'
          4        SEND_VAL_EX                                              'an'
          5        SEND_VAL_EX                                              'example'
          6        SEND_VAL_EX                                              'of'
          7        SEND_VAL_EX                                              'variadics'
          8        DO_FCALL                                      0  $2      
          9        ECHO                                                     $2
         10      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J0GLP
function name:  bar
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'implode'
          1        SEND_VAL                                                 '+'
          2        FUNC_GET_ARGS                                    ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
    9     6*     > RETURN                                                   null

End of function bar

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J0GLP
function name:  __call
number of ops:  12
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        INIT_FCALL                                               'array_unshift'
          3        SEND_REF                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   14     6        INIT_METHOD_CALL                                         'bar'
          7        SEND_UNPACK                                              !1
          8        CHECK_UNDEF_ARGS                                         
          9        DO_FCALL                                      1  $3      
         10      > RETURN                                                   $3
   15    11*     > RETURN                                                   null

End of function __call

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.73 ms | 1396 KiB | 17 Q