3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xpnd($scientific, $precision){ # expand from scientific notation if(is_int($scientific)){ #don't convert integers return $scientific; } return sprintf("%.".$precision."F", $scientific); } echo "1 - ".bcdiv(0.0000967, 2, 10)."\n"; echo "2 - ".(40075036/86164.098903691)."\n"; echo "3 - ".bcdiv(xpnd(0.0000967, 10), 2, 10)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0VJ07
function name:  (null)
number of ops:  22
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL_BY_NAME                                       'bcdiv'
          1        SEND_VAL_EX                                              9.67e-5
          2        SEND_VAL_EX                                              2
          3        SEND_VAL_EX                                              10
          4        DO_FCALL                                      0  $0      
          5        CONCAT                                           ~1      '1+-+', $0
          6        CONCAT                                           ~2      ~1, '%0A'
          7        ECHO                                                     ~2
   10     8        ECHO                                                     '2+-+465.10131841329%0A'
   11     9        INIT_FCALL_BY_NAME                                       'bcdiv'
         10        INIT_FCALL                                               'xpnd'
         11        SEND_VAL                                                 9.67e-5
         12        SEND_VAL                                                 10
         13        DO_FCALL                                      0  $3      
         14        SEND_VAR_NO_REF_EX                                       $3
         15        SEND_VAL_EX                                              2
         16        SEND_VAL_EX                                              10
         17        DO_FCALL                                      0  $4      
         18        CONCAT                                           ~5      '3+-+', $4
         19        CONCAT                                           ~6      ~5, '%0A'
         20        ECHO                                                     ~6
         21      > RETURN                                                   1

Function xpnd:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0VJ07
function name:  xpnd
number of ops:  13
compiled vars:  !0 = $scientific, !1 = $precision
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        TYPE_CHECK                                   16          !0
          3      > JMPZ                                                     ~2, ->5
    4     4    > > RETURN                                                   !0
    6     5    >   INIT_FCALL                                               'sprintf'
          6        CONCAT                                           ~3      '%25.', !1
          7        CONCAT                                           ~4      ~3, 'F'
          8        SEND_VAL                                                 ~4
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11      > RETURN                                                   $5
    7    12*     > RETURN                                                   null

End of function xpnd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.25 ms | 1399 KiB | 16 Q