3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rate1 = 0.02; $var = sprintf("%.2f",1260); //$var holds numeric string var_dump($var,"\n\n"); $var = 1260; $product = $var * $rate1; var_dump("product:", $product,"\n"); // two ways to format $product echo number_format( $product, 2),"\n"; echo printf("%f",$product);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E98JQ
function name:  (null)
number of ops:  30
compiled vars:  !0 = $rate1, !1 = $var, !2 = $product
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0.02
    4     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%25.2f'
          3        SEND_VAL                                                 1260
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 '%0A%0A'
          9        DO_ICALL                                                 
    7    10        ASSIGN                                                   !1, 1260
    9    11        MUL                                              ~8      !1, !0
         12        ASSIGN                                                   !2, ~8
   11    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAL                                                 'product%3A'
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 '%0A'
         17        DO_ICALL                                                 
   14    18        INIT_FCALL                                               'number_format'
         19        SEND_VAR                                                 !2
         20        SEND_VAL                                                 2
         21        DO_ICALL                                         $11     
         22        ECHO                                                     $11
         23        ECHO                                                     '%0A'
   16    24        INIT_FCALL                                               'printf'
         25        SEND_VAL                                                 '%25f'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $12     
         28        ECHO                                                     $12
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.78 ms | 1395 KiB | 21 Q