3v4l.org

run code in 300+ PHP versions simultaneously
<?php class P{ public $foo; } class C extends P { public $lol; public function getFields() { $p = array_keys(get_class_vars(get_parent_class(C))); $c = array_keys(get_class_vars(C)); return array_diff($c, $p); } } $c = new C(); var_dump($c->getFields());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RlcOE
function name:  (null)
number of ops:  9
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getFields'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class P: [no user functions]
Class C:
Function getfields:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RlcOE
function name:  getFields
number of ops:  25
compiled vars:  !0 = $p, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'array_keys'
          1        INIT_FCALL                                               'get_class_vars'
          2        INIT_FCALL                                               'get_parent_class'
          3        FETCH_CONSTANT                                   ~2      'C'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
   13    11        INIT_FCALL                                               'array_keys'
         12        INIT_FCALL                                               'get_class_vars'
         13        FETCH_CONSTANT                                   ~7      'C'
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !1, $9
   14    19        INIT_FCALL                                               'array_diff'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $11     
         23      > RETURN                                                   $11
   16    24*     > RETURN                                                   null

End of function getfields

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.64 ms | 1396 KiB | 23 Q