3v4l.org

run code in 300+ PHP versions simultaneously
<?php class P { public function test_prop($prop) { return property_exists($this, $prop); } } class Child extends P { private $prop1; } $child = new Child(); echo $child->test_prop('prop1') ? 'Yes' : 'No';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bM4OG
function name:  (null)
number of ops:  12
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        INIT_METHOD_CALL                                         !0, 'test_prop'
          4        SEND_VAL_EX                                              'prop1'
          5        DO_FCALL                                      0  $4      
          6      > JMPZ                                                     $4, ->9
          7    >   QM_ASSIGN                                        ~5      'Yes'
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~5      'No'
         10    >   ECHO                                                     ~5
         11      > 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/bM4OG
function name:  test_prop
number of ops:  8
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'property_exists'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > 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/bM4OG
function name:  test_prop
number of ops:  8
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'property_exists'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of function test_prop

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.74 ms | 1396 KiB | 15 Q