3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { private $_name = 'sina'; private $_age = '27'; private $_employer = 'yes'; public function get_name() { return $this->_name; } public function get_age() { return $this->_age; } public function get_employer() { return $this->_employer; } } $person = new Person(); $person->get_name(); $required = array('name','age'); foreach($required as $req) { $func = "get_{$req}()"; echo $person->$$func; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/JWjH2
function name:  (null)
number of ops:  18
compiled vars:  !0 = $person, !1 = $required, !2 = $req, !3 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $4      'Person'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   27     3        INIT_METHOD_CALL                                         !0, 'get_name'
          4        DO_FCALL                                      0          
   28     5        ASSIGN                                                   !1, <array>
   29     6      > FE_RESET_R                                       $9      !1, ->16
          7    > > FE_FETCH_R                                               $9, !2, ->16
   31     8    >   ROPE_INIT                                     3  ~11     'get_'
          9        ROPE_ADD                                      1  ~11     ~11, !2
         10        ROPE_END                                      2  ~10     ~11, '%28%29'
         11        ASSIGN                                                   !3, ~10
   32    12        FETCH_R                      local               ~14     !3
         13        FETCH_OBJ_R                                      ~15     !0, ~14
         14        ECHO                                                     ~15
   29    15      > JMP                                                      ->7
         16    >   FE_FREE                                                  $9
   33    17      > RETURN                                                   1

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

End of function get_name

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

End of function get_age

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

End of function get_employer

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.77 ms | 1399 KiB | 13 Q