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; } $child = new Child(); var_dump($child->test_prop('prop1')); //true, as of PHP 5.3.0 var_dump($child->test_prop('prop2'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CUVS9
function name:  (null)
number of ops:  16
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     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                                                 
   13     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      > 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/CUVS9
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_prop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CUVS9
function name:  test_prop
number of ops:  7
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          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:
154.21 ms | 1396 KiB | 17 Q