3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Programmer { // Class Properties var $name; // Programmer's name var $experience; // How long has been programming var $lang; // Favorite Language var $education; // Highest degree earned // Class Constructor - function same name as the class function Programmer($name, $experience, $lang, $education) { $this->name=$name; $this->experience=$experience; $this->lang=$lang; $this->education=$education; } // Getter/Setter functions for all properties in the class function get_name() { return $this->name; } function set_name($newname) { $this->name = $newname; } function get_experience() { return $this->experience; } function set_experience($newexperience) { $this->experience = $newexperience; } function get_lang() { return $this->lang; } function set_lang($newlang) { $this->lang = $newlang; } function get_education() { return $this->education; } function set_education($neweducation) { $this->education = $neweducation; } // Utility data dump function function output() { echo "Programmer Name: ".$this->name."<br>"; echo $this->name." has ".$this->experience." years of programming experience.<br>"; echo $this->lang." is ".$this->name."'s favorite programming language.<br>"; echo $this->name." holds the degree: ".$this->education."<br><br>"; } } // Instantiating a programmer $paul = new Programmer('Paul Conrad',12,'C++','Bachelor of Science in Computer Science'); $paul->output(); // Oops, Paul has programmed alot longer than 12 year, really is 22 years $paul->set_experience(22); $paul->output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $paul
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   NEW                                              $1      'Programmer'
          1        SEND_VAL_EX                                              'Paul+Conrad'
          2        SEND_VAL_EX                                              12
          3        SEND_VAL_EX                                              'C%2B%2B'
          4        SEND_VAL_EX                                              'Bachelor+of+Science+in+Computer+Science'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   50     7        INIT_METHOD_CALL                                         !0, 'output'
          8        DO_FCALL                                      0          
   52     9        INIT_METHOD_CALL                                         !0, 'set_experience'
         10        SEND_VAL_EX                                              22
         11        DO_FCALL                                      0          
   53    12        INIT_METHOD_CALL                                         !0, 'output'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class Programmer:
Function programmer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  Programmer
number of ops:  13
compiled vars:  !0 = $name, !1 = $experience, !2 = $lang, !3 = $education
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   10     4        ASSIGN_OBJ                                               'name'
          5        OP_DATA                                                  !0
   11     6        ASSIGN_OBJ                                               'experience'
          7        OP_DATA                                                  !1
   12     8        ASSIGN_OBJ                                               'lang'
          9        OP_DATA                                                  !2
   13    10        ASSIGN_OBJ                                               'education'
         11        OP_DATA                                                  !3
   14    12      > RETURN                                                   null

End of function programmer

Function get_name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  get_name
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function get_name

Function set_name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  set_name
number of ops:  4
compiled vars:  !0 = $newname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
   21     3      > RETURN                                                   null

End of function set_name

Function get_experience:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  get_experience
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                      ~0      'experience'
          1      > RETURN                                                   ~0
   24     2*     > RETURN                                                   null

End of function get_experience

Function set_experience:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  set_experience
number of ops:  4
compiled vars:  !0 = $newexperience
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        ASSIGN_OBJ                                               'experience'
          2        OP_DATA                                                  !0
   27     3      > RETURN                                                   null

End of function set_experience

Function get_lang:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  get_lang
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'lang'
          1      > RETURN                                                   ~0
   30     2*     > RETURN                                                   null

End of function get_lang

Function set_lang:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  set_lang
number of ops:  4
compiled vars:  !0 = $newlang
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   32     1        ASSIGN_OBJ                                               'lang'
          2        OP_DATA                                                  !0
   33     3      > RETURN                                                   null

End of function set_lang

Function get_education:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  get_education
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   FETCH_OBJ_R                                      ~0      'education'
          1      > RETURN                                                   ~0
   36     2*     > RETURN                                                   null

End of function get_education

Function set_education:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  set_education
number of ops:  4
compiled vars:  !0 = $neweducation
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   38     1        ASSIGN_OBJ                                               'education'
          2        OP_DATA                                                  !0
   39     3      > RETURN                                                   null

End of function set_education

Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ktHNZ
function name:  output
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      'Programmer+Name%3A+', ~0
          2        CONCAT                                           ~2      ~1, '%3Cbr%3E'
          3        ECHO                                                     ~2
   43     4        FETCH_OBJ_R                                      ~3      'name'
          5        CONCAT                                           ~4      ~3, '+has+'
          6        FETCH_OBJ_R                                      ~5      'experience'
          7        CONCAT                                           ~6      ~4, ~5
          8        CONCAT                                           ~7      ~6, '+years+of+programming+experience.%3Cbr%3E'
          9        ECHO                                                     ~7
   44    10        FETCH_OBJ_R                                      ~8      'lang'
         11        CONCAT                                           ~9      ~8, '+is+'
         12        FETCH_OBJ_R                                      ~10     'name'
         13        CONCAT                                           ~11     ~9, ~10
         14        CONCAT                                           ~12     ~11, '%27s+favorite+programming+language.%3Cbr%3E'
         15        ECHO                                                     ~12
   45    16        FETCH_OBJ_R                                      ~13     'name'
         17        CONCAT                                           ~14     ~13, '+holds+the+degree%3A+'
         18        FETCH_OBJ_R                                      ~15     'education'
         19        CONCAT                                           ~16     ~14, ~15
         20        CONCAT                                           ~17     ~16, '%3Cbr%3E%3Cbr%3E'
         21        ECHO                                                     ~17
   46    22      > RETURN                                                   null

End of function output

End of class Programmer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.9 ms | 1403 KiB | 13 Q