3v4l.org

run code in 300+ PHP versions simultaneously
<?php $p = 14; function format($f) { $p = (int) ini_get('precision'); return (string) round($f, $p); } 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/jJ90n
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
    9     1        INIT_FCALL                                               'format'
          2        SEND_VAL                                                 6.66667
          3        DO_FCALL                                      0  $2      
          4        CONCAT                                           ~3      $2, '%0A'
          5        ECHO                                                     ~3
   10     6        INIT_FCALL                                               'format'
          7        SEND_VAL                                                 6.66
          8        DO_FCALL                                      0  $4      
          9        CONCAT                                           ~5      $4, '%0A'
         10        ECHO                                                     ~5
   11    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/jJ90n
function name:  format
number of ops:  13
compiled vars:  !0 = $f, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'ini_get'
          2        SEND_VAL                                                 'precision'
          3        DO_ICALL                                         $2      
          4        CAST                                          4  ~3      $2
          5        ASSIGN                                                   !1, ~3
    6     6        INIT_FCALL                                               'round'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        CAST                                          6  ~6      $5
         11      > RETURN                                                   ~6
    7    12*     > RETURN                                                   null

End of function format

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.79 ms | 1399 KiB | 20 Q