Re: Scalar Type Hinting

From: Date: Thu, 08 Mar 2012 06:09:49 +0000
Subject: Re: Scalar Type Hinting
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 3/7/2012 8:48 PM, John Crenshaw wrote:

In fact, nearly every input to PHP is a string. This is why PHP was designed with some seriously robust type juggling on scalars. Any typing proposal that wants to actually pass a vote is going to have to allow appropriate implicit conversions from string to other types.
In fact, nearly every output from PHP is a string. Also why PHP was designed with some seriously robust type juggling on scalars. Any typing proposal that wants to actually pass a vote is going to have to allow appropriate implicit conversions to string from other types. $x = 1.8; $y = 2.3; list( $int, $fract ) = explode( '.', $x + $y );

Thread (43 messages)

« previous php.internals (#58765) next »