3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Decimal($data, $commas = 2, $point = false) { if ($point == false) return number_format((float)$data, $commas, ',', '.'); else return str_replace(',', '.', number_format((float)$data, $commas, ',', '.')); } echo Decimal(0.144 * 9, 3, true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pq2M4
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'decimal'
          1        SEND_VAL                                                 1.296
          2        SEND_VAL                                                 3
          3        SEND_VAL                                                 <true>
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
          6      > RETURN                                                   1

Function decimal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pq2M4
function name:  Decimal
number of ops:  28
compiled vars:  !0 = $data, !1 = $commas, !2 = $point
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      2
          2        RECV_INIT                                        !2      <false>
    4     3        BOOL_NOT                                         ~3      !2
          4      > JMPZ                                                     ~3, ->14
          5    >   INIT_FCALL                                               'number_format'
          6        CAST                                          5  ~4      !0
          7        SEND_VAL                                                 ~4
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 '%2C'
         10        SEND_VAL                                                 '.'
         11        DO_ICALL                                         $5      
         12      > RETURN                                                   $5
         13*       JMP                                                      ->27
    5    14    >   INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '%2C'
         16        SEND_VAL                                                 '.'
         17        INIT_FCALL                                               'number_format'
         18        CAST                                          5  ~6      !0
         19        SEND_VAL                                                 ~6
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 '%2C'
         22        SEND_VAL                                                 '.'
         23        DO_ICALL                                         $7      
         24        SEND_VAR                                                 $7
         25        DO_ICALL                                         $8      
         26      > RETURN                                                   $8
    6    27*     > RETURN                                                   null

End of function decimal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.8 ms | 1020 KiB | 16 Q