3v4l.org

run code in 300+ PHP versions simultaneously
<?php function percentage($val1, $val2, $precision) { $division = $val1 / $val2; $res = $division * 100; $res = round($res, $precision); return $res; } echo percentage(10, 299, 2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YWpAn
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'percentage'
          1        SEND_VAL                                                 10
          2        SEND_VAL                                                 299
          3        SEND_VAL                                                 2
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
          6      > RETURN                                                   1

Function percentage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YWpAn
function name:  percentage
number of ops:  14
compiled vars:  !0 = $val1, !1 = $val2, !2 = $precision, !3 = $division, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        DIV                                              ~5      !0, !1
          4        ASSIGN                                                   !3, ~5
    6     5        MUL                                              ~7      !3, 100
          6        ASSIGN                                                   !4, ~7
    8     7        INIT_FCALL                                               'round'
          8        SEND_VAR                                                 !4
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !4, $9
   10    12      > RETURN                                                   !4
   11    13*     > RETURN                                                   null

End of function percentage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.97 ms | 1397 KiB | 16 Q