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(); $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 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/YDckD
function name:  (null)
number of ops:  16
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        ASSIGN                                                   !1, <array>
   28     4      > FE_RESET_R                                       $8      !1, ->14
          5    > > FE_FETCH_R                                               $8, !2, ->14
   30     6    >   ROPE_INIT                                     3  ~10     'get_'
          7        ROPE_ADD                                      1  ~10     ~10, !2
          8        ROPE_END                                      2  ~9      ~10, '%28%29'
          9        ASSIGN                                                   !3, ~9
   31    10        FETCH_R                      local               ~13     !3
         11        FETCH_OBJ_R                                      ~14     !0, ~13
         12        ECHO                                                     ~14
   28    13      > JMP                                                      ->5
         14    >   FE_FREE                                                  $8
   32    15      > 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/YDckD
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/YDckD
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/YDckD
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:
138.08 ms | 1395 KiB | 13 Q