3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 0.000000000014; $end = str_replace(".", "", explode("E-", $value)[0]); Preg_match("/\.\d+" . $end ."/", number_format($value, 100), $match); $decimal = strlen($match[0])-1; Echo "fixed 50 decimals\t" .number_format($value, 50) . "\n"; Echo "calculated decimals\t" .number_format($value, $decimal);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ai0kE
function name:  (null)
number of ops:  41
compiled vars:  !0 = $value, !1 = $end, !2 = $match, !3 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1.4e-11
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '.'
          3        SEND_VAL                                                 ''
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 'E-'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        FETCH_DIM_R                                      ~6      $5, 0
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
    5    12        INIT_FCALL                                               'preg_match'
         13        CONCAT                                           ~9      '%2F%5C.%5Cd%2B', !1
         14        CONCAT                                           ~10     ~9, '%2F'
         15        SEND_VAL                                                 ~10
         16        INIT_FCALL                                               'number_format'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 100
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        SEND_REF                                                 !2
         22        DO_ICALL                                                 
    6    23        FETCH_DIM_R                                      ~13     !2, 0
         24        STRLEN                                           ~14     ~13
         25        SUB                                              ~15     ~14, 1
         26        ASSIGN                                                   !3, ~15
    8    27        INIT_FCALL                                               'number_format'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 50
         30        DO_ICALL                                         $17     
         31        CONCAT                                           ~18     'fixed+50+decimals%09', $17
         32        CONCAT                                           ~19     ~18, '%0A'
         33        ECHO                                                     ~19
    9    34        INIT_FCALL                                               'number_format'
         35        SEND_VAR                                                 !0
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                         $20     
         38        CONCAT                                           ~21     'calculated+decimals%09', $20
         39        ECHO                                                     ~21
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.07 ms | 1014 KiB | 17 Q