3v4l.org

run code in 300+ PHP versions simultaneously
<?php class P { private $prop2; public function test_prop($prop) { return property_exists(__CLASS__, $prop); } } class Child extends P { private $prop1; public function test_prop2($prop) { return property_exists(__CLASS__, $prop); } } $child = new Child(); var_dump($child->test_prop('prop1')); //true, as of PHP 5.3.0 var_dump($child->test_prop('prop2')); var_dump($child->test_prop2('prop1')); var_dump($child->test_prop2('prop2'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/677Z2
function name:  (null)
number of ops:  28
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'test_prop'
          5        SEND_VAL_EX                                              'prop1'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   14     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'test_prop'
         11        SEND_VAL_EX                                              'prop2'
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
   15    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !0, 'test_prop2'
         17        SEND_VAL_EX                                              'prop1'
         18        DO_FCALL                                      0  $8      
         19        SEND_VAR                                                 $8
         20        DO_ICALL                                                 
   16    21        INIT_FCALL                                               'var_dump'
         22        INIT_METHOD_CALL                                         !0, 'test_prop2'
         23        SEND_VAL_EX                                              'prop2'
         24        DO_FCALL                                      0  $10     
         25        SEND_VAR                                                 $10
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class P:
Function test_prop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/677Z2
function name:  test_prop
number of ops:  7
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'property_exists'
          2        SEND_VAL                                                 'P'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function test_prop

End of class P.

Class Child:
Function test_prop2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/677Z2
function name:  test_prop2
number of ops:  7
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'property_exists'
          2        SEND_VAL                                                 'Child'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function test_prop2

Function test_prop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/677Z2
function name:  test_prop
number of ops:  7
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'property_exists'
          2        SEND_VAL                                                 'P'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function test_prop

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.96 ms | 1400 KiB | 17 Q