3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Calculator { public function getDiscount($price=0, $sale=0) { return ($price-$sale)/$price * 100; } } $calculator = new Calculator(); echo $calculator->getDiscount(100,80);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tTVvV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $calculator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'Calculator'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'getDiscount'
          4        SEND_VAL_EX                                              100
          5        SEND_VAL_EX                                              80
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Class Calculator:
Function getdiscount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tTVvV
function name:  getDiscount
number of ops:  7
compiled vars:  !0 = $price, !1 = $sale
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      0
          1        RECV_INIT                                        !1      0
    5     2        SUB                                              ~2      !0, !1
          3        DIV                                              ~3      ~2, !0
          4        MUL                                              ~4      ~3, 100
          5      > RETURN                                                   ~4
    6     6*     > RETURN                                                   null

End of function getdiscount

End of class Calculator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.55 ms | 1394 KiB | 13 Q