RE: [PHP-DEV] [RFC] Safe Casting Functions
| From: | Zeev Suraski | Date: | Wed, 22 Oct 2014 08:26:16 +0000 |
| Subject: | RE: [PHP-DEV] [RFC] Safe Casting Functions | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78221@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Stas Malyshev [mailto:smalyshev@sugarcrm.com]
> Sent: Wednesday, October 22, 2014 11:18 AM
> To: Dmitry Stogov; Andrea Faulds
> Cc: PHP Internals
> Subject: Re: [PHP-DEV] [RFC] Safe Casting Functions
>
> Hi!
>
> >>> - it's probably make sense to implement these function as a new
> >> opcode(s) in VM
> >>
> >> That could be an optimisation later, yes. I note that you’ve added
> >> function replacement with opcodes for certain commonly-used
> >> functions. We could make these functions use that. Then they’d still
> >> be usable as callbacks.
>
> If those are opcodes, those rules will require 2/3 majority for
> acceptance,
> since those will be the engine rules for type conversion, not just a set
> of
> functions. And, of course, the rules not matching the other engine rules
> for
> type conversion, sorry for sounding like broken record.
Regardless of how we implement it, this requires a 2/3 majority - it'll be
perceived as an integral part of the core language in the same way that
gettype() and is_array() are considered parts of the core language.
Introducing a new set of typing rules into PHP cannot be a 50%+1 decision.
Zeev