3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller{ public $rating1; public $rating2; } class Ratings { public function __construct($rating1, $rating2) { $this->rating1 = $rating1; $this->rating2 = $rating2; } public function calculateChange() { return round(1 / (1 + pow(10, ($this->rating2 - $this->rating1) / 400)) * 100); } } echo (new Ratings(4, 5))->calculateChange() . "%";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XTs2U
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'Ratings'
          1        SEND_VAL_EX                                              4
          2        SEND_VAL_EX                                              5
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'calculateChange'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, '%25'
          7        ECHO                                                     ~3
          8      > RETURN                                                   1

Class Controller: [no user functions]
Class Ratings:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XTs2U
function name:  __construct
number of ops:  7
compiled vars:  !0 = $rating1, !1 = $rating2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ASSIGN_OBJ                                               'rating1'
          3        OP_DATA                                                  !0
   11     4        ASSIGN_OBJ                                               'rating2'
          5        OP_DATA                                                  !1
   12     6      > RETURN                                                   null

End of function __construct

Function calculatechange:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XTs2U
function name:  calculateChange
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'round'
          1        INIT_FCALL                                               'pow'
          2        SEND_VAL                                                 10
          3        FETCH_OBJ_R                                      ~0      'rating2'
          4        FETCH_OBJ_R                                      ~1      'rating1'
          5        SUB                                              ~2      ~0, ~1
          6        DIV                                              ~3      ~2, 400
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                         $4      
          9        ADD                                              ~5      1, $4
         10        DIV                                              ~6      1, ~5
         11        MUL                                              ~7      ~6, 100
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14      > RETURN                                                   $8
   16    15*     > RETURN                                                   null

End of function calculatechange

End of class Ratings.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.9 ms | 1396 KiB | 17 Q