Re: RE: Optional scalar type hinting

From: Date: Thu, 03 Jan 2008 21:51:41 +0000
Subject: Re: RE: Optional scalar type hinting
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-34360@lists.php.net to get a copy of this message
There aren't two code models here at all. You can have a function parameter, or you can have a type-enforced function parameter. PHP
So now to use such function you'd have to check your variables for typing - otherwise your application blows up. And the type-checking should be total - otherwise you miss some call to some function or some code path bringing wrong value and your application blows up at runtime - since static type checking is not available. Meaning, unless all of your code is type-enforced, you'd have to write a wrapper around each type-enforced function manually checking that wrong value didn't get in. But you can do the same checks now, so what is the added value? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#34360) next »