3v4l.org

run code in 300+ PHP versions simultaneously
<?php $p = 14; function format($f) { return (string) round($f, (int) ini_get('precision')); } echo format(20/3) . "\n"; echo format(6.66) . "\n"; echo format(6) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0qgT3
function name:  (null)
number of ops:  17
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 14
    8     1        INIT_FCALL                                               'format'
          2        SEND_VAL                                                 6.66667
          3        DO_FCALL                                      0  $2      
          4        CONCAT                                           ~3      $2, '%0A'
          5        ECHO                                                     ~3
    9     6        INIT_FCALL                                               'format'
          7        SEND_VAL                                                 6.66
          8        DO_FCALL                                      0  $4      
          9        CONCAT                                           ~5      $4, '%0A'
         10        ECHO                                                     ~5
   10    11        INIT_FCALL                                               'format'
         12        SEND_VAL                                                 6
         13        DO_FCALL                                      0  $6      
         14        CONCAT                                           ~7      $6, '%0A'
         15        ECHO                                                     ~7
         16      > RETURN                                                   1

Function format:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0qgT3
function name:  format
number of ops:  12
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'round'
          2        SEND_VAR                                                 !0
          3        INIT_FCALL                                               'ini_get'
          4        SEND_VAL                                                 'precision'
          5        DO_ICALL                                         $1      
          6        CAST                                          4  ~2      $1
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                         $3      
          9        CAST                                          6  ~4      $3
         10      > RETURN                                                   ~4
    6    11*     > RETURN                                                   null

End of function format

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.82 ms | 1399 KiB | 20 Q