3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParentClass { public function getProperty($propertyName) { return $this->{$propertyName}; } public function setProperty($propertyName, $value) { $this->{$propertyName} = $value; return $this; } } class MyChildClass extends MyParentClass { protected $foo; protected $bar; } $child = new MyChildClass(); $child ->setProperty('foo', 'lulu') ->setProperty('bar', true); var_dump( $child->getProperty('foo'), $child->getProperty('bar') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alV0q
function name:  (null)
number of ops:  22
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'MyChildClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'setProperty'
          4        SEND_VAL_EX                                              'foo'
          5        SEND_VAL_EX                                              'lulu'
          6        DO_FCALL                                      0  $4      
   27     7        INIT_METHOD_CALL                                         $4, 'setProperty'
          8        SEND_VAL_EX                                              'bar'
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
   29    11        INIT_FCALL                                               'var_dump'
   30    12        INIT_METHOD_CALL                                         !0, 'getProperty'
         13        SEND_VAL_EX                                              'foo'
         14        DO_FCALL                                      0  $6      
         15        SEND_VAR                                                 $6
   31    16        INIT_METHOD_CALL                                         !0, 'getProperty'
         17        SEND_VAL_EX                                              'bar'
         18        DO_FCALL                                      0  $7      
         19        SEND_VAR                                                 $7
         20        DO_ICALL                                                 
   32    21      > RETURN                                                   1

Class MyParentClass:
Function getproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alV0q
function name:  getProperty
number of ops:  4
compiled vars:  !0 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
    8     3*     > RETURN                                                   null

End of function getproperty

Function setproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alV0q
function name:  setProperty
number of ops:  7
compiled vars:  !0 = $propertyName, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   13     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   14     6*     > RETURN                                                   null

End of function setproperty

End of class MyParentClass.

Class MyChildClass:
Function getproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alV0q
function name:  getProperty
number of ops:  4
compiled vars:  !0 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
    8     3*     > RETURN                                                   null

End of function getproperty

Function setproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alV0q
function name:  setProperty
number of ops:  7
compiled vars:  !0 = $propertyName, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   13     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   14     6*     > RETURN                                                   null

End of function setproperty

End of class MyChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.13 ms | 1392 KiB | 15 Q