3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Greeter { function greet($name, ...$args) { var_dump($name); var_dump($args); } } $g = new Greeter; $g->greet("foo", "bar", "baz"); $args = ["foo", "bar", "baz"]; $g->greet(...$args);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OdZFP
function name:  (null)
number of ops:  14
compiled vars:  !0 = $g, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Greeter'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   11     3        INIT_METHOD_CALL                                         !0, 'greet'
          4        SEND_VAL_EX                                              'foo'
          5        SEND_VAL_EX                                              'bar'
          6        SEND_VAL_EX                                              'baz'
          7        DO_FCALL                                      0          
   13     8        ASSIGN                                                   !1, <array>
   14     9        INIT_METHOD_CALL                                         !0, 'greet'
         10        SEND_UNPACK                                              !1
         11        CHECK_UNDEF_ARGS                                         
         12        DO_FCALL                                      1          
         13      > RETURN                                                   1

Class Greeter:
Function greet:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OdZFP
function name:  greet
number of ops:  9
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    5     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    7     8      > RETURN                                                   null

End of function greet

End of class Greeter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.42 ms | 1395 KiB | 15 Q