3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_subtract(array $input) { return array_shift($input) - array_sum($input); } $array = ["one" => 50, "two" => 6, 8, 9]; echo array_subtract($array); // Outputs 27
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S0nDD
function name:  (null)
number of ops:  6
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_subtract'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function array_subtract:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S0nDD
function name:  array_subtract
number of ops:  10
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'array_shift'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                         $1      
          4        INIT_FCALL                                               'array_sum'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SUB                                              ~3      $1, $2
          8      > RETURN                                                   ~3
    5     9*     > RETURN                                                   null

End of function array_subtract

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.3 ms | 1001 KiB | 16 Q