3v4l.org

run code in 500+ PHP versions simultaneously
<?php function calculateTotal(string $item, float $price, int $quantity = 1): string { $subtotal = $price * $quantity; return "$quantityx $item = $$subtotal"; } // Call the function and print the result echo calculateTotal($item, $price, $quantity);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP681
function name:  (null)
number of ops:  7
compiled vars:  !0 = $item, !1 = $price, !2 = $quantity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'calculatetotal'
          1        SEND_VAR                                                 !0
          2        SEND_VAR                                                 !1
          3        SEND_VAR                                                 !2
          4        DO_FCALL                                      0  $3      
          5        ECHO                                                     $3
          6      > RETURN                                                   1

Function calculatetotal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lP681
function name:  calculateTotal
number of ops:  14
compiled vars:  !0 = $item, !1 = $price, !2 = $quantity, !3 = $subtotal, !4 = $quantityx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      1
    4     3        MUL                                              ~5      !1, !2
          4        ASSIGN                                                   !3, ~5
    5     5        ROPE_INIT                                     5  ~8      !4
          6        ROPE_ADD                                      1  ~8      ~8, '+'
          7        ROPE_ADD                                      2  ~8      ~8, !0
          8        ROPE_ADD                                      3  ~8      ~8, '+%3D+%24'
          9        ROPE_END                                      4  ~7      ~8, !3
         10        VERIFY_RETURN_TYPE                                       ~7
         11      > RETURN                                                   ~7
    6    12*       VERIFY_RETURN_TYPE                                       
         13*     > RETURN                                                   null

End of function calculatetotal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.25 ms | 1339 KiB | 14 Q