3v4l.org

run code in 500+ PHP versions simultaneously
<?php function roudUp(float $amount) : string { $fraction = 2; $mult = pow(10, $fraction); $roundedUp = ceil($amount * $mult) / $mult; return number_format($roundedUp, 2); } echo roudUp(1.6);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWATr
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'roudup'
          1        SEND_VAL                                                     1.6
          2        DO_FCALL                                          0  $0      
          3        ECHO                                                         $0
          4      > RETURN                                                       1

Function roudup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWATr
function name:  roudUp
number of ops:  21
compiled vars:  !0 = $amount, !1 = $fraction, !2 = $mult, !3 = $roundedUp
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, 2
    5     2        INIT_FCALL                                                   'pow'
          3        SEND_VAL                                                     10
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                             $5      
          6        ASSIGN                                                       !2, $5
    6     7        INIT_FCALL                                                   'ceil'
          8        MUL                                                  ~7      !0, !2
          9        SEND_VAL                                                     ~7
         10        DO_ICALL                                             $8      
         11        DIV                                                  ~9      $8, !2
         12        ASSIGN                                                       !3, ~9
    7    13        INIT_FCALL                                                   'number_format'
         14        SEND_VAR                                                     !3
         15        SEND_VAL                                                     2
         16        DO_ICALL                                             $11     
         17        VERIFY_RETURN_TYPE                                           $11
         18      > RETURN                                                       $11
    8    19*       VERIFY_RETURN_TYPE                                           
         20*     > RETURN                                                       null

End of function roudup

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.96 ms | 1861 KiB | 16 Q