3v4l.org

run code in 300+ PHP versions simultaneously
<?php function round_up($number, $precision = 2) { $fig = (int) str_pad('1', $precision, '0'); return (ceil($number * $fig) / $fig); } echo round_up(23500);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aHLMI
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'round_up'
          1        SEND_VAL                                                 23500
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

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

End of function round_up

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.1 ms | 1397 KiB | 18 Q