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(__CLASS__))); $c = array_keys(get_class_vars(__CLASS__)); return array_diff($c, $p); } } $c = new C(); print_r($c->getFields());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tbgNT
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                                               'print_r'
          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/tbgNT
function name:  getFields
number of ops:  23
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        SEND_VAL                                                 'C'
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
   13    10        INIT_FCALL                                               'array_keys'
         11        INIT_FCALL                                               'get_class_vars'
         12        SEND_VAL                                                 'C'
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                         $7      
         16        ASSIGN                                                   !1, $7
   14    17        INIT_FCALL                                               'array_diff'
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
         21      > RETURN                                                   $9
   16    22*     > RETURN                                                   null

End of function getfields

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.39 ms | 1388 KiB | 23 Q