Hi!
> It's also impossible to write a PHP class with "internal state" - state
> that I can't find at run-time with reflection. That's what makes the
> language reflective. Internal state in this sense is something foreign
> to PHP as well, the only exception being things like resources, but
>
> Of course they are possible. See __get/__set
Not the same thing at all - PDOStatement::$queryString is a read-only
property, which cannot be overridden, not even with __get() as you would be
able to for regular __get() in a regular PHP class.
It's also impossible to write a PHP class with
Hi!
> I know that things like internal state and read-only properties are
> possible for classes written in C, but those features aren't possible in
> PHP code - classes that behave this way are inconsistent with classes
Of course they are possible. See __get/__set. But yes, internal classes
On 04/06/16 21:23, Stanislav Malyshev wrote:
> 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.
This is also why DateTime is useless for many data handling functions
since
On 6/4/2016 11:05 PM, Rasmus Schultz wrote:
> I know that things like internal state and read-only properties are
> possible for classes written in C, but those features aren't possible in
> PHP code - classes that behave this way are inconsistent with classes
> written in the language, and it
> In generic case, you can't have internal state of an object, that's why it's
internal
I know that things like internal state and read-only properties are
possible for classes written in C, but those features aren't possible in
PHP code - classes that behave this way are inconsistent with
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
On Sat, Jun 4, 2016 at 9:42 PM, Jordi Boggiano wrote:
> On 04/06/2016 20:36, Rasmus Schultz wrote:
>
>> I wrote a library that can serialize/unserialize PHP object graphs to JSON
>> data.
>>
>> Somebody reported it doesn't work on the DateTime class.
>>
>> Does this
On Sat, 04 Jun 2016 22:36:19 +0300, Rasmus Schultz
wrote:
I wrote a library that can serialize/unserialize PHP object graphs to
JSON
data.
Somebody reported it doesn't work on the DateTime class.
Does this deliberately not work?
$date = new DateTime();
On 04/06/2016 20:36, Rasmus Schultz wrote:
I wrote a library that can serialize/unserialize PHP object graphs to JSON
data.
Somebody reported it doesn't work on the DateTime class.
Does this deliberately not work?
$date = new DateTime();
var_dump($date);
outputs:
I wrote a library that can serialize/unserialize PHP object graphs to JSON
data.
Somebody reported it doesn't work on the DateTime class.
Does this deliberately not work?
$date = new DateTime();
var_dump($date);
outputs:
object(DateTime)#1 (3) {
["date"]=>
string(19)
11 matches
Mail list logo