3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1111111.505; $round = round($a, 2); echo "round: " . $round . "\n"; $sprintf = sprintf('%01.2F', $a); echo "sprintf: " . $sprintf . "\n"; echo "round * 100: " . $round . "\n"; echo bcmul($round, 100). "\n"; echo "sprintf * 100: " . $sprintf . "\n"; echo bcmul($sprintf, 100). "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lZWaY
function name:  (null)
number of ops:  36
compiled vars:  !0 = $a, !1 = $round, !2 = $sprintf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1.11111e+6
    4     1        INIT_FCALL                                               'round'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        CONCAT                                           ~6      'round%3A+', !1
          7        CONCAT                                           ~7      ~6, '%0A'
          8        ECHO                                                     ~7
    6     9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 '%2501.2F'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    7    14        CONCAT                                           ~10     'sprintf%3A+', !2
         15        CONCAT                                           ~11     ~10, '%0A'
         16        ECHO                                                     ~11
    9    17        CONCAT                                           ~12     'round+%2A+100%3A+', !1
         18        CONCAT                                           ~13     ~12, '%0A'
         19        ECHO                                                     ~13
   10    20        INIT_FCALL_BY_NAME                                       'bcmul'
         21        SEND_VAR_EX                                              !1
         22        SEND_VAL_EX                                              100
         23        DO_FCALL                                      0  $14     
         24        CONCAT                                           ~15     $14, '%0A'
         25        ECHO                                                     ~15
   12    26        CONCAT                                           ~16     'sprintf+%2A+100%3A+', !2
         27        CONCAT                                           ~17     ~16, '%0A'
         28        ECHO                                                     ~17
   13    29        INIT_FCALL_BY_NAME                                       'bcmul'
         30        SEND_VAR_EX                                              !2
         31        SEND_VAL_EX                                              100
         32        DO_FCALL                                      0  $18     
         33        CONCAT                                           ~19     $18, '%0A'
         34        ECHO                                                     ~19
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.87 ms | 1396 KiB | 17 Q