# WIKI Account Request

- Thread: https://externals.io/message/85215
- Original archive: https://news-web.php.net/php.internals/85215
- Started by Mike Willbanks on 2015-03-19T14:35:07+00:00
- Messages: 4
- RFC: Scalar Type Casting Magic Methods (Inactive) — https://externals.io/rfc/object_cast_to_types.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #85215 — Mike Willbanks — 2015-03-19T14:35:07+00:00

URL: https://externals.io/message/85215#85215

Hello Internals,

I had requested a wiki account (mwillbanks) as I would like to propose an
RFC on Object casts to scalar types.  This has previously been discussed
prior to scalar type hints and since we have those now coming into PHP 7, I
believe it would be a great time to take a look at this for 7.1 (Discussion
will not be immediate as focus needs to be put into 7.0)

The last RFC had gone inactive back from 2012:
https://wiki.php.net/rfc/object_cast_to_types and I have talked with
ircmaxell about doing something similar but making it more inline with STH
as well as supporting a generalized __cast.

The general cruft of it is to have objects have the ability to support:
+ __toInt
+ __toFloat
+ __toBool
+ __toArray
+ __cast

Removing the existing having __toScalar as it would no longer make sense in
this context.  __cast would be utilized more or less as function((int)
constant_type) where as it may mean PHP_TYPE_* as initial feedback on the
idea showed that it would be the most generalist approach and might be
useful in that context.

Regards,

Mike

---

## #85370 — Ferenc Kovacs — 2015-03-21T14:58:04+00:00

URL: https://externals.io/message/85215#85370 · In reply to: #85215

> Hello Internals,
>
> I had requested a wiki account (mwillbanks) as I would like to propose an
> RFC on Object casts to scalar types.  This has previously been discussed
> prior to scalar type hints and since we have those now coming into PHP 7, I
> believe it would be a great time to take a look at this for 7.1 (Discussion
> will not be immediate as focus needs to be put into 7.0)
>
> The last RFC had gone inactive back from 2012:
> https://wiki.php.net/rfc/object_cast_to_types and I have talked with
> ircmaxell about doing something similar but making it more inline with STH
> as well as supporting a generalized __cast.
>
> The general cruft of it is to have objects have the ability to support:
> + __toInt
> + __toFloat
> + __toBool
> + __toArray
> + __cast
>
> Removing the existing having __toScalar as it would no longer make sense in
> this context.  __cast would be utilized more or less as function((int)
> constant_type) where as it may mean PHP_TYPE_* as initial feedback on the
> idea showed that it would be the most generalist approach and might be
> useful in that context.
>
> Regards,
>
> Mike
>

Hi,

I can't find your account request, are you sure you was able to submit it?
The form won't be submitted if you fill out the ' To which email address do
you have to send an email now?' question wrong.
-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #85379 — Christoph Becker — 2015-03-21T17:13:00+00:00

URL: https://externals.io/message/85215#85379 · In reply to: #85370

Ferenc Kovacs wrote:

> I can't find your account request, are you sure you was able to submit it?
> The form won't be submitted if you fill out the ' To which email address do
> you have to send an email now?' question wrong.

There should be a meaningful error message now (since a few days), if
submitting the form fails for whatever reason.

-- 
Christoph M. Becker

---

## #85386 — Ferenc Kovacs — 2015-03-21T20:50:36+00:00

URL: https://externals.io/message/85215#85386 · In reply to: #85379

> Ferenc Kovacs wrote:
>
> > […]
> it?
> > […]
> do
> > […]
>
> There should be a meaningful error message now (since a few days), if
> submitting the form fails for whatever reason.
>
> --
> Christoph M. Becker
>

nice.
for the record he managed to sign up after my email and I granted him rfc
karma.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu
