3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array( 20/3, 20/3 * 1e6, 6.66, 6.0, 60.0, ); foreach ($numbers as $n) { echo 'RAW: ' . $n . "\n"; echo 'EXP: ' . var_export($n, TRUE) . "\n"; echo 'FIX: ' . rtrim(rtrim(sprintf('%.14F', $n), '0'), '.') . "\n"; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 30
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 30
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/fiegm
function name:  (null)
number of ops:  32
compiled vars:  !0 = $numbers, !1 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1      > FE_RESET_R                                       $3      !0, ->30
          2    > > FE_FETCH_R                                               $3, !1, ->30
   12     3    >   CONCAT                                           ~4      'RAW%3A+', !1
          4        CONCAT                                           ~5      ~4, '%0A'
          5        ECHO                                                     ~5
   13     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $6      
         10        CONCAT                                           ~7      'EXP%3A+', $6
         11        CONCAT                                           ~8      ~7, '%0A'
         12        ECHO                                                     ~8
   14    13        INIT_FCALL                                               'rtrim'
         14        INIT_FCALL                                               'rtrim'
         15        INIT_FCALL                                               'sprintf'
         16        SEND_VAL                                                 '%25.14F'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        SEND_VAL                                                 '0'
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        SEND_VAL                                                 '.'
         24        DO_ICALL                                         $11     
         25        CONCAT                                           ~12     'FIX%3A+', $11
         26        CONCAT                                           ~13     ~12, '%0A'
         27        ECHO                                                     ~13
   15    28        ECHO                                                     '%0A'
   11    29      > JMP                                                      ->2
         30    >   FE_FREE                                                  $3
   16    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.69 ms | 1396 KiB | 19 Q