iterate only through existing objects properties, not them from parent class?

Posted by ajsie on Stack Overflow See other posts from Stack Overflow or by ajsie
Published on 2010-04-12T06:36:33Z Indexed on 2010/04/12 6:43 UTC
Read the original article Hit count: 227

Filed under:
|

i have a class that extends another.

when i iterate the current object i get all properties, even those from the superclass.

i only want to iterate through the current object. how could i do that?

foreach($this as $key => $value) {
    echo $key . ': ' . $value;
}

© Stack Overflow or respective owner

Related posts about php

Related posts about oop