3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar{} function foo(Bar ...$bars) { echo "Got " . count($bars) . " bars.\n"; } $bars = [new Bar, new Bar, new Bar]; foo(...$bars); $ints = [1, 2, 3]; foo(...$ints);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JX3MC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $bars, !1 = $ints
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Bar'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~4      $2
          3        NEW                                              $5      'Bar'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~4      $5
          6        NEW                                              $7      'Bar'
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~4      $7
          9        ASSIGN                                                   !0, ~4
   12    10        INIT_FCALL                                               'foo'
         11        SEND_UNPACK                                              !0
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      1          
   14    14        ASSIGN                                                   !1, <array>
   16    15        INIT_FCALL                                               'foo'
         16        SEND_UNPACK                                              !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      1          
         19      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JX3MC
function name:  foo
number of ops:  6
compiled vars:  !0 = $bars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_VARIADIC                                    !0      
    7     1        COUNT                                            ~1      !0
          2        CONCAT                                           ~2      'Got+', ~1
          3        CONCAT                                           ~3      ~2, '+bars.%0A'
          4        ECHO                                                     ~3
    8     5      > RETURN                                                   null

End of function foo

Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.46 ms | 1398 KiB | 15 Q