3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmDOF
function name:  foo
number of ops:  11
compiled vars:  !0 = $bars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
          2        INIT_DYNAMIC_CALL                                        ~1
          3        SEND_UNPACK                                              !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1  $2      
          6        ASSIGN                                                   !0, $2
   10     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   11    10      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmDOF
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $bars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_VARIADIC                                    !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of Dynamic Function 0

End of function foo

Class Bar: [no user functions]
Class Baz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.98 ms | 1013 KiB | 16 Q