Re: RE: Optional scalar type hinting

From: Date: Fri, 04 Jan 2008 00:07:35 +0000
Subject: Re: RE: Optional scalar type hinting
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-34375@lists.php.net to get a copy of this message
$n2 is a string value of the number one. What happens if, during a more complex computation an incorrect value is store to $n2, lets say an alphabetic character? The value would be interpreted as a zero and the result would be wrong.
If you change data, result changes - surprise! If you set $n2 to 42, result would be wrong too, if by right you mean $n2 being 1 and not 42. How it has anything to do with static typing? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#34375) next »