Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread Richard Quadling
2009/7/2 Stanislav Malyshev : > It's not about the user input and security - it's about having different > parts of your code working together through all possible changes. If you've > got strict API you've got to make sure what you are sending to it would pass > those strict checks, and would keep

Re: [PHP-DEV] Re: Flexible type hinting

2009-07-03 Thread Richard Quadling
2009/7/2 Stanislav Malyshev : > Hi! > >>    function func(int $i) >> >> for strict type checking, and >> >>    function func((int)$i) > > Without saying anything on the merits of having both syntaxes, visually I > think this looks much nicer, even with the disadvantage of parentheses > overload. O

Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread David Coallier
2009/7/1 Ilia Alshanetsky : > There has been quite a bit of discussion on this list, IRC, developer > meetings, etc... about introduction of type hinting to PHP. Most people > appear to think that this would be a good idea, but there is a reason why it > is not in PHP already. The main source of co

[PHP-DEV] Re: Flexible type hinting

2009-07-03 Thread Paul Biggar
Hi Ilia, On Thu, Jul 2, 2009 at 3:35 AM, Paul Biggar wrote: > Thanks to Ilia for getting to ball rolling on scalar type hinting. > I believe I have a solution that caters to each crowd, without being > too complicated. My impression is that there only minor support for the "flexible" approach, an

Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread Paul Biggar
Hi Ilia, Your patch doesn't support a "null" (or maybe it should be called "unset") type check. Its uses would be rare, but I think it should be present for completeness. Thanks, Paul On Wed, Jul 1, 2009 at 5:59 PM, Ilia Alshanetsky wrote: > There has been quite a bit of discussion on this lis

Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread Paul Biggar
Hi Ilia, On Wed, Jul 1, 2009 at 7:07 PM, Stanislav Malyshev wrote: >> The patch is available here: http://ia.gd/patch/type_hint_53.txt > > Technical comment: as this patch changes binary API this shouldn't happen in > 5.3 branch. So maybe it's better to make it for 6. Index: Zend/zend_compile.h

Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread Ilia Alshanetsky
Good point, this way API could remain the same. On 3-Jul-09, at 9:31 AM, Paul Biggar wrote: Hi Ilia, On Wed, Jul 1, 2009 at 7:07 PM, Stanislav Malyshev wrote: The patch is available here: http://ia.gd/patch/type_hint_53.txt Technical comment: as this patch changes binary API this shouldn'

Re: [PHP-DEV] Re: Flexible type hinting

2009-07-03 Thread Lukas Kahwe Smith
On 03.07.2009, at 15:04, Paul Biggar wrote: Hi Ilia, On Thu, Jul 2, 2009 at 3:35 AM, Paul Biggar wrote: Thanks to Ilia for getting to ball rolling on scalar type hinting. I believe I have a solution that caters to each crowd, without being too complicated. My impression is that there only

Re: [PHP-DEV] Re: Flexible type hinting

2009-07-03 Thread Paul Biggar
Hi Lukas, On Fri, Jul 3, 2009 at 2:35 PM, Lukas Kahwe Smith wrote: > hmm not sure that the consensus of a "weak" check would be an automatic > cast. Actually that wouldnt be much of a check in that case. I think the > other side is more asking for what Ilia already begun with "numeric" in the > se

Re: [PHP-DEV] Re: Flexible type hinting

2009-07-03 Thread Rodrigo Saboya
Ford, Mike wrote: function func(int $i) for strict type checking, and function func((int)$i) for coercion aka casting (although now I've seen it written down I'm not so sure! ;). I had thought about having "weak" and "strong' type checking even before Paul sent his proposal, but I

Re: [PHP-DEV] Re: Flexible type hinting

2009-07-03 Thread Lukas Kahwe Smith
On 03.07.2009, at 15:04, Paul Biggar wrote: Since this can be built as an extra step on top of your patch, this can be added later (although it would obviously be great if you preferred to add it now...). I recommend you proceed with the next step of getting your patch accepted (I presume an RF

[PHP-DEV] Veracity of statement that FastCGI is always enabled cannot be disabled in PHP 5.3

2009-07-03 Thread Ryan Schmidt
Hi. I'm the maintainer of PHP in MacPorts and I'm in the process of updating our php5 port to version 5.3.0. I originally posted this message to the php-install list but was asked via private mail from Christopher Jones to re-post it here on the internals list. http://marc.info/?l=php-insta

Re: [PHP-DEV] Veracity of statement that FastCGI is always enabled cannot be disabled in PHP 5.3

2009-07-03 Thread Gwynne Raskind
I apologize for the top-quoting, but it seemed appropriate here. It seems the language of the documentation is unclear. It is not that the CGI SAPI (now called the CGI-FCGI SAPI) is always built, in the fashion of CLI. It is, precisely, that the FastCGI support within the CGI SAPI can no lo

Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread Stanislav Malyshev
Hi! I think you could make this work for 5.3, if it used the old "zend_bool array_type_hint". A zend_bool is 8 bits, so that's plenty. It would be a little bit messy, but I'm fairly confident it could be made work. Unless the particular module would interpret everything that has non-zero arra

Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3

2009-07-03 Thread Stanislav Malyshev
Hi! I wonder if the split is between people coming to PHP from web design (JavaScript/Perl) and coming to PHP from other programming languages (VB/Java/C++/COBOL/ColdFusion - a long list [1]). I've mainly come I've learned Java in about '96 and Perl around the same time. I wonder which box yo

[PHP-DEV] weak and strict type checking RFC

2009-07-03 Thread Lukas Kahwe Smith
Hi, Last evening I put together a quick proposal for a weak and strict checking approach, since I felt that things were being concluded a bit prematurely. More importantly I detailed the issues I see with a pure strict type checking only approach. I am publishing it a bit prematurely imho