3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add($a, $b) { return $a + $b; } echo add(...[1, 2])."\n"; $a = [1, 2]; echo add(...$a); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fcWdK
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'add'
          1        SEND_UNPACK                                              <array>
          2        CHECK_UNDEF_ARGS                                         
          3        DO_FCALL                                      1  $1      
          4        CONCAT                                           ~2      $1, '%0A'
          5        ECHO                                                     ~2
    8     6        ASSIGN                                                   !0, <array>
    9     7        INIT_FCALL                                               'add'
          8        SEND_UNPACK                                              !0
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      1  $4      
         11        ECHO                                                     $4
   10    12      > RETURN                                                   1

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fcWdK
function name:  add
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        ADD                                              ~2      !0, !1
          3      > RETURN                                                   ~2
    4     4*     > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.69 ms | 1010 KiB | 15 Q