3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myceil(int|float $number, int $precision, int $decimals) { return number_format(ceil($number*(10**$precision))/(10**$precision), 2); } echo myceil(46.38,1, 2).PHP_EOL; echo myceil(46.40,1, 2).PHP_EOL; echo myceil(46.41,1, 2).PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b1g0q
function name:  (null)
number of ops:  22
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'myceil'
          1        SEND_VAL                                                 46.38
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 2
          4        DO_FCALL                                      0  $0      
          5        CONCAT                                           ~1      $0, '%0A'
          6        ECHO                                                     ~1
   10     7        INIT_FCALL                                               'myceil'
          8        SEND_VAL                                                 46.4
          9        SEND_VAL                                                 1
         10        SEND_VAL                                                 2
         11        DO_FCALL                                      0  $2      
         12        CONCAT                                           ~3      $2, '%0A'
         13        ECHO                                                     ~3
   11    14        INIT_FCALL                                               'myceil'
         15        SEND_VAL                                                 46.41
         16        SEND_VAL                                                 1
         17        SEND_VAL                                                 2
         18        DO_FCALL                                      0  $4      
         19        CONCAT                                           ~5      $4, '%0A'
         20        ECHO                                                     ~5
   12    21      > RETURN                                                   1

Function myceil:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b1g0q
function name:  myceil
number of ops:  16
compiled vars:  !0 = $number, !1 = $precision, !2 = $decimals
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        INIT_FCALL                                               'number_format'
          4        INIT_FCALL                                               'ceil'
          5        POW                                              ~3      10, !1
          6        MUL                                              ~4      !0, ~3
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        POW                                              ~6      10, !1
         10        DIV                                              ~7      $5, ~6
         11        SEND_VAL                                                 ~7
         12        SEND_VAL                                                 2
         13        DO_ICALL                                         $8      
         14      > RETURN                                                   $8
    6    15*     > RETURN                                                   null

End of function myceil

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.36 ms | 1002 KiB | 18 Q