Re: [RFC] [DISCUSSION] Scalar Pseudo-type

From: Date: Sun, 24 Dec 2017 17:25:27 +0000
Subject: Re: [RFC] [DISCUSSION] Scalar Pseudo-type
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-101415@lists.php.net to get a copy of this message
On 12/24/2017 5:42 PM, Fleshgrinder wrote: > I will extend it with some examples. > > I guess that that would be useful in weak mode. Will try to hack it in. > > I am currently also working on another RFC that adds a > Convertible > interface with a single into method that has its return type > set to > scalar where objects can opt-in to become > scalar compatible. Even in > strict mode. The idea is that the object's into method is > automatically called by the engine and the receiver gets the canonical > scalar value that represents the object. This is specifically > useful > for value objects that often represent single scalar values in > a type > safe manner. > Added some examples but I will stop now working on anything because people already start complaining again. Contributing to PHP is like kicking a combat dog ... let's wait for some support for this feature in general first. -- Richard "Fleshgrinder" Fussenegger

« previous php.internals (#101415) next »