3v4l.org

run code in 300+ PHP versions simultaneously
<?php $float = 0.0000000038; echo "$float\n"; $str = (string)$float; echo "$str\n"; $n_dec = strlen(substr(strrch($str, '.'), 1)); echo "$n_dec\n"; echo number_format($float, $n_dec), "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9V9Td
function name:  (null)
number of ops:  29
compiled vars:  !0 = $float, !1 = $str, !2 = $n_dec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 3.8e-9
    4     1        NOP                                                      
          2        FAST_CONCAT                                      ~4      !0, '%0A'
          3        ECHO                                                     ~4
    5     4        CAST                                          6  ~5      !0
          5        ASSIGN                                                   !1, ~5
    6     6        NOP                                                      
          7        FAST_CONCAT                                      ~7      !1, '%0A'
          8        ECHO                                                     ~7
    8     9        INIT_FCALL                                               'substr'
         10        INIT_FCALL_BY_NAME                                       'strrch'
         11        SEND_VAR_EX                                              !1
         12        SEND_VAL_EX                                              '.'
         13        DO_FCALL                                      0  $8      
         14        SEND_VAR                                                 $8
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $9      
         17        STRLEN                                           ~10     $9
         18        ASSIGN                                                   !2, ~10
   10    19        NOP                                                      
         20        FAST_CONCAT                                      ~12     !2, '%0A'
         21        ECHO                                                     ~12
   12    22        INIT_FCALL                                               'number_format'
         23        SEND_VAR                                                 !0
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $13     
         26        ECHO                                                     $13
         27        ECHO                                                     '%0A'
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.1 ms | 1387 KiB | 17 Q