Re: [RFC] UString
| From: | Joe Watkins | Date: | Wed, 01 Jul 2015 06:46:52 +0000 |
| Subject: | Re: [RFC] UString | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86984@lists.php.net to get a copy of this message | ||
Morning,
> Why would that be expected behaviour? I mean I can't do
>
> $date = (DateTime) $timestring;
No, but you can't do:
$string = (string) $datetime;
But can do:
$string = (string) $ustring;
Where $ustring is instanceof UString.
Even if you never write $string = (string) $ustring, the engine will
perform the same
action all the time, whenever you pass a UString to anything expecting
string.
It feels like a complete implementation should support both casts.
Cheers
Joe
On Wed, Jul 1, 2015 at 7:38 AM, Andreas Heigl <andreas@heigl.org> wrote:
> Hi Joe.
>
> Am 01.07.15 um 07:36 schrieb Joe Watkins:
> > [..]
> >
> > Another possible issue is engine integration:
> >
> > $string = (UString) $someString;
> > $string = (UString) "someString";
> >
> > These aren't very different to 'new UString', but for an integrated
> > solution, kind of expected to work.
>
> Why would that be expected behaviour? I mean I can't do
>
> $date = (DateTime) $timestring;
>
> after all, can I? But I can use
>
> $date = new DateTime($timestring);
>
> Just my 2 Cent.
>
> Cheers
>
> Andreas
> --
> ,,,
> (o o)
> +---------------------------------------------------------ooO-(_)-Ooo-+
> | Andreas Heigl |
> | mailto:andreas@heigl.org N
> 50°22'59.5" E 08°23'58" |
> | http://andreas.heigl.org
> http://hei.gl/wiFKy7 |
> +---------------------------------------------------------------------+
> | http://hei.gl/root-ca
> |
> +---------------------------------------------------------------------+
>
>