3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertFloat($float) { $float = (string)$float; $expPos = strpos($float, 'E-'); if ($expPos === false) { return $float; } $numberWithoutPrecision = substr($float, 0, $expPos); $exp = (int)substr($float, $expPos + 1, strlen($float)); var_dump($numberWithoutPrecision, $exp); } convertFloat(1.004e-300);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kRUnr
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'convertfloat'
          1        SEND_VAL                                                 1.004e-300
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function convertfloat:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kRUnr
function name:  convertFloat
number of ops:  31
compiled vars:  !0 = $float, !1 = $expPos, !2 = $numberWithoutPrecision, !3 = $exp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        CAST                                          6  ~4      !0
          2        ASSIGN                                                   !0, ~4
    5     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'E-'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
    7     8        TYPE_CHECK                                    4          !1
          9      > JMPZ                                                     ~8, ->11
    8    10    > > RETURN                                                   !0
   11    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
   12    17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !0
         19        ADD                                              ~11     !1, 1
         20        SEND_VAL                                                 ~11
         21        STRLEN                                           ~12     !0
         22        SEND_VAL                                                 ~12
         23        DO_ICALL                                         $13     
         24        CAST                                          4  ~14     $13
         25        ASSIGN                                                   !3, ~14
   14    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !2
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                                 
   15    30      > RETURN                                                   null

End of function convertfloat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.28 ms | 1399 KiB | 20 Q