3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Message {} class WrongMessage {} function test(Message ...$messages) { var_dump($messages); } $messages = [new Message(), new Message]; $messagesWithSuprise = [new Message(), new WrongMessage()]; test(...$messages); test(new Message, new Message); test(...$messagesWithSuprise);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3UdED
function name:  (null)
number of ops:  31
compiled vars:  !0 = $messages, !1 = $messagesWithSuprise
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'Message'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~4      $2
          3        NEW                                              $5      'Message'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~4      $5
          6        ASSIGN                                                   !0, ~4
   13     7        NEW                                              $8      'Message'
          8        DO_FCALL                                      0          
          9        INIT_ARRAY                                       ~10     $8
         10        NEW                                              $11     'WrongMessage'
         11        DO_FCALL                                      0          
         12        ADD_ARRAY_ELEMENT                                ~10     $11
         13        ASSIGN                                                   !1, ~10
   15    14        INIT_FCALL                                               'test'
         15        SEND_UNPACK                                              !0
         16        CHECK_UNDEF_ARGS                                         
         17        DO_FCALL                                      1          
   16    18        INIT_FCALL                                               'test'
         19        NEW                                              $15     'Message'
         20        DO_FCALL                                      0          
         21        SEND_VAR                                                 $15
         22        NEW                                              $17     'Message'
         23        DO_FCALL                                      0          
         24        SEND_VAR                                                 $17
         25        DO_FCALL                                      0          
   17    26        INIT_FCALL                                               'test'
         27        SEND_UNPACK                                              !1
         28        CHECK_UNDEF_ARGS                                         
         29        DO_FCALL                                      1          
         30      > RETURN                                                   1

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

End of function test

Class Message: [no user functions]
Class WrongMessage: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.91 ms | 1399 KiB | 18 Q