Re: can't reflection on DateTime properties?
| From: | Stanislav Malyshev | Date: | Sat, 04 Jun 2016 20:23:31 +0000 |
| Subject: | Re: can't reflection on DateTime properties? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93781@lists.php.net to get a copy of this message | ||
Hi!
> The object clearly has properties corresponding to it's internal state, but
> reflection doesn't seem to report them?
Reflection reports defined properties, but classes can have dynamic
properties that are not pre-defined. var_dump also has a separate
handler, so the object can present different information to var_dump.
> Also, what comes out of var_dump() appears to be something intended for
> human consumption? I'm guessing that's not the actual internal state of the
> object - most likely the internal state consists of the "timezone_type" and
> an integer timestamp?
In generic case, you can't have internal state of an object, that's why
it's internal. If you need to serialize data, there are
serialize/unserialize handlers for it.
--
Stas Malyshev
smalyshev@gmail.com