3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Employee { public $name; public $department; public $salary; public function getAnnualBonus(){ return $this->$salary * 0.1; } } $employeeAlice = new Employee(); $employeeAlice->name = "Alice"; $employeeAlice->department = "IT"; $employeeAlice->salary = 80000; echo $employeeAlice-> getAnnualBonus();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uUC35
function name:  (null)
number of ops:  13
compiled vars:  !0 = $employeeAlice
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   NEW                                                  $1      'Employee'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   13     3        ASSIGN_OBJ                                                   !0, 'name'
          4        OP_DATA                                                      'Alice'
   14     5        ASSIGN_OBJ                                                   !0, 'department'
          6        OP_DATA                                                      'IT'
   15     7        ASSIGN_OBJ                                                   !0, 'salary'
          8        OP_DATA                                                      80000
   16     9        INIT_METHOD_CALL                                             !0, 'getAnnualBonus'
         10        DO_FCALL                                          0  $7      
         11        ECHO                                                         $7
         12      > RETURN                                                       1

Class Employee:
Function getannualbonus:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uUC35
function name:  getAnnualBonus
number of ops:  4
compiled vars:  !0 = $salary
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                          ~1      !0
          1        MUL                                                  ~2      ~1, 0.1
          2      > RETURN                                                       ~2
    9     3*     > RETURN                                                       null

End of function getannualbonus

End of class Employee.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
145.2 ms | 483 KiB | 9 Q