Re: Casting from parent class to child

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 8, 2010 at 12:50 PM, Nathan Rixham <nrixham@xxxxxxxxx> wrote:
> David Harkness wrote:
>>
>> Casting does not change an object. You must copy the relevant value(s)
>> from
>> the object returned into a new DateTimePlus. Since DateTime's constructor
>> takes only a string, and I assume it won't accept your format directly,
>
> unless you implement __toString I believe (not tested)
>

IMO, that would be a truly useful feature to add if you were extending
DateTime anyway.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux