3v4l.org

run code in 500+ PHP versions simultaneously
<?php function multiply(...$nums): int|float { $nums = array_filter($nums, 'is_numeric'); return array_product($nums); } echo multiply(10, 20) . "\n"; echo multiply("A", 10, 30) . "\n"; echo multiply(100.5, 10, "B") . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MgJM2
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                                   'multiply'
          1        SEND_VAL                                                     10
          2        SEND_VAL                                                     20
          3        DO_FCALL                                          0  $0      
          4        CONCAT                                               ~1      $0, '%0A'
          5        ECHO                                                         ~1
    8     6        INIT_FCALL                                                   'multiply'
          7        SEND_VAL                                                     'A'
          8        SEND_VAL                                                     10
          9        SEND_VAL                                                     30
         10        DO_FCALL                                          0  $2      
         11        CONCAT                                               ~3      $2, '%0A'
         12        ECHO                                                         ~3
    9    13        INIT_FCALL                                                   'multiply'
         14        SEND_VAL                                                     100.5
         15        SEND_VAL                                                     10
         16        SEND_VAL                                                     'B'
         17        DO_FCALL                                          0  $4      
         18        CONCAT                                               ~5      $4, '%0A'
         19        ECHO                                                         ~5
         20      > RETURN                                                       1

Function multiply:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MgJM2
function name:  multiply
number of ops:  13
compiled vars:  !0 = $nums
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                        !0      
    4     1        INIT_FCALL                                                   'array_filter'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     'is_numeric'
          4        DO_ICALL                                             $1      
          5        ASSIGN                                                       !0, $1
    5     6        INIT_FCALL                                                   'array_product'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                             $3      
          9        VERIFY_RETURN_TYPE                                           $3
         10      > RETURN                                                       $3
    6    11*       VERIFY_RETURN_TYPE                                           
         12*     > RETURN                                                       null

End of function multiply

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.81 ms | 1756 KiB | 18 Q