[PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend.c zend_execute_API.c zend_vm_def.h zend_vm_execute.h php-src NEWS

2008-04-17 Thread Dmitry Stogov
Another idea: In case xdebug overwrites zend_execute() it can set EG(return_value_ptr_ptr) to point to some local variable then call original executor and then print pass return_value to caller or destroy it dependent on previous value of EG(return_value_ptr_ptr). Thanks. Dmitry. Derick

Re: [PHP-DEV] Exceptions = Apache Crash in PHP 5.3 Snaps

2008-04-17 Thread Dmitry Stogov
Hi Scott, Could you provide a script to reproduce the crash? Thanks. Dmitry. Scott MacVicar wrote: Jeremy Privett wrote: Another week later and still no response. I would hope /someone/ thinks this a critical issue and needs to be resolved. Is /anyone/ looking at this at all? Thanks.

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Arvids Godjuks
What about types like array mixed Ok, for mixed we may not use type hinting at all - does patch allow to hint only part of function args? If we have a function, witch takes as 1st argument array or string and other args should have strict types or just use call like myFunc(Array($string), .)

[PHP-DEV] CVS Account Request: preeti

2008-04-17 Thread Preeti Teotia
For maintaining synchronize code in the team -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PATCH] Scanner fixes and tweaks

2008-04-17 Thread Matt Wilmas
Hello guys, - Original Message - From: Philip Olson Sent: Thursday, April 10, 2008 On 10 Apr 2008, at 09:48, Marcus Boerger wrote: Hello Matt, Thursday, April 10, 2008, 3:50:41 PM, you wrote: Hi Scott, [...] BTW, maybe you could change the name in that 5.2 NEWS entry to

[PHP-DEV] Re: [RFC] Type hints (parameter and return value)

2008-04-17 Thread Christian Schneider
Felipe Pena wrote: For parameter type hints, i have completed the actual implementation with the leftover php types: - string (binary string and unicode) - integer (accepting numeric string too) - double (accepting numeric string too) - boolean ('0', '1', true, false) - resource - object

Re: [PHP-DEV] [PATCH] Scanner fixes and tweaks

2008-04-17 Thread Antony Dovgal
On 17.04.2008 14:54, Matt Wilmas wrote: Well, now that I have a php.net account, and 5.2.6 will be released, can someone change my name? :-) Unless I'm granted access to do it myself...? Done =) Didn't know that about short names -- I see my name 11 times in the 5.2 NEWS, and the last 6 are

Re: [PHP-DEV] Re: [RFC] Type hints (parameter and return value)

2008-04-17 Thread Arvids Godjuks
Christian Schneider I don't like the difference between function (int) test($value) { ... } and function test(integer $value) { ... } First is function return value should be int, second is function arg should be int. So full syntax will be like this function (integer)

Re: [PHP-DEV] [PATCH] Scanner fixes and tweaks

2008-04-17 Thread Matt Wilmas
Thanks Tony! - Original Message - From: Antony Dovgal Sent: Thursday, April 17, 2008 On 17.04.2008 14:54, Matt Wilmas wrote: Well, now that I have a php.net account, and 5.2.6 will be released, can someone change my name? :-) Unless I'm granted access to do it myself...? Done =)

Re: [PHP-DEV] Re: [RFC] Type hints (parameter and return value)

2008-04-17 Thread Christian Schneider
Arvids Godjuks wrote: So full syntax will be like this function (integer) test(integer $value) { ... } I guess you are right: int and integer seem to be aliase and both check for int *or* numeric strings, not the type int. It is also not clear if (string) accepts ints/floats which are often

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
Hi, Your current implementation seems to be inconsistent with both itself and the rest of PHP. I hope this can be rectified before it is included. PHP is inconsisent enough without adding more. 1.) There are a number of is_* functions. It seems obvious that they should be consistent with this.

[PHP-DEV] CVS Account Request: barzaz

2008-04-17 Thread Clément Turbelin
Helping to develop Package Services_Webervice and its doc. I talked with the leader of the package (Manfred Weber) and Helgi Þormar Þorbjörnsson (dufuz) and they told me to request this account. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Exceptions = Apache Crash in PHP 5.3 Snaps

2008-04-17 Thread Vesselin Kenashkov
My original message was sent just to Dmitry (instead to thel ist), and he replied (again only to me instead to the list) that it is fixed in the CVS. Sorry for the confusion. Thanks for the fix. Vesselin Kenashkov On Thu, Apr 17, 2008 at 4:01 PM, Dmitry Stogov [EMAIL PROTECTED] wrote: The bug

Re: [PHP-DEV] Exceptions = Apache Crash in PHP 5.3 Snaps

2008-04-17 Thread Elizabeth M Smith
Dmitry Stogov wrote: Hi Scott, Could you provide a script to reproduce the crash? Thanks. Dmitry. Scott MacVicar wrote: Jeremy Privett wrote: Another week later and still no response. I would hope /someone/ thinks this a critical issue and needs to be resolved. Is /anyone/ looking

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 14:52 +0200, Paul Biggar wrote: Hi, Your current implementation seems to be inconsistent with both itself and the rest of PHP. I hope this can be rectified before it is included. PHP is inconsisent enough without adding more. 1.) There are a number of is_*

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Alain Williams
On Thu, Apr 17, 2008 at 10:01:13AM -0400, Sam Barrow wrote: On Thu, 2008-04-17 at 14:52 +0200, Paul Biggar wrote: just the copy in the callee - I think this is a good idea). As an example, this will fail, which it shouldnt: function y (int $x) { assert (is_int($x); } y (24); The problem

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
Hi Sam, On Thu, Apr 17, 2008 at 4:01 PM, Sam Barrow [EMAIL PROTECTED] wrote: \ 2.) is_int has different semantics to the int type hint. Numeric strings qualify as the latter, but not the former. In general this is a problem. It seems type hints can only be made consistent if they

[PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Felipe Pena
Hi. Well, thinking better about the behavior of type hinting, i decided to change the proposal for strict type. I.e. don't accept numeric string as an intenger, etc. If anyone wants use type hinting, i believe that it should be strict. Otherwise, it makes more sense to not use it. Examples,

[PHP-DEV] Win32 mail() issue and potential fix - needs better brains than me to verify solution.

2008-04-17 Thread Richard Quadling
Hi. I have finally managed to get php to compile for windows (yippee for me). So I can now try and get mail() working again. The issue is that in ext/standard/mail.c (/* $Id: mail.c,v 1.87.2.1.2.7.2.3 2007/12/31 07:17:15 sebastian Exp $ */), line 197, the test of ... if (!sendmail_path)

Re: [PHP-DEV] CVS Account Request

2008-04-17 Thread Tatsuo Ishii
Here are the patches against 5.2 HEAD. Modified API's are: 1) pg_lo_create now accepts an optional parameter (large object id). This corresponds to lo_create() which is new in PostgreSQL 8.1. 2) new API: pg_lo_import_with_oid. Same as pg_lo_import except that it accepts large object id.

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
Hi Felipe, Thanks for making the change. This is much more consistent. It remains that there is no 'scalar' or 'numeric' hint. Are you planning on including them? I also wonder about allowing NULL for an 'array' type hint. Is this acceptable? The patch seems to indicate it is. If so, why is this

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Felipe Pena
Em Qui, 2008-04-17 às 17:17 +0200, Paul Biggar escreveu: Hi Felipe, Thanks for making the change. This is much more consistent. It remains that there is no 'scalar' or 'numeric' hint. Are you planning on including them? No, i'm not planning to do that. I also wonder about allowing NULL

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
On Thu, Apr 17, 2008 at 5:24 PM, Felipe Pena [EMAIL PROTECTED] wrote: Thanks for making the change. This is much more consistent. It remains that there is no 'scalar' or 'numeric' hint. Are you planning on including them? No, i'm not planning to do that. Ah, I should have been more

[PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Christian Schneider
Felipe Pena wrote: Well, thinking better about the behavior of type hinting, i decided to change the proposal for strict type. I.e. don't accept numeric string as an intenger, etc. While it is now consistent with is_int() it means we end up with strict but also stupid interfaces and hence lots

Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Chris Stockton
I like this patch, it adds a feature which a lot of companies and code base would surely implement without breaking anything. The only thing I do not like has already been mentioned, numeric and scalar are not included. The one thing I don't dislike, but am unsure of the ease to understand by

Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Pierre Joye
Hi Christian, On Thu, Apr 17, 2008 at 5:41 PM, Christian Schneider [EMAIL PROTECTED] wrote: Felipe Pena wrote: Well, thinking better about the behavior of type hinting, i decided to change the proposal for strict type. I.e. don't accept numeric string as an intenger, etc. While it is

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
In this case, I'd suggest using my patch for parameter type hinting. It utilizes the current type hinting system for minimal code changes, whereas this is a whole new set of functionality. It also has scalar and number types, and supports objects with __tostring methods. On Thu, 2008-04-17 at

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 17:29 +0200, Paul Biggar wrote: On Thu, Apr 17, 2008 at 5:24 PM, Felipe Pena [EMAIL PROTECTED] wrote: Thanks for making the change. This is much more consistent. It remains that there is no 'scalar' or 'numeric' hint. Are you planning on including them? No,

Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Chris Stockton
On Thu, Apr 17, 2008 at 9:01 AM, Sam Barrow [EMAIL PROTECTED] wrote: I like this alot better too, the only downside is compatibility problems. Can you explain, I understand; in partial the problem but I am curious what can not be solved through added logic?

Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 09:18 -0700, Chris Stockton wrote: On Thu, Apr 17, 2008 at 9:01 AM, Sam Barrow [EMAIL PROTECTED] wrote: I like this alot better too, the only downside is compatibility problems. Can you explain, I understand; in partial the problem but I am curious what can not

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! If anyone wants use type hinting, i believe that it should be strict. Otherwise, it makes more sense to not use it. Just for the record, I see absolutely no sense in strict type hints. While there might be some use cases when you want to save typing by having function convert the

Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 08:54 -0700, Chris Stockton wrote: I like this patch, it adds a feature which a lot of companies and code base would surely implement without breaking anything. The only thing I do not like has already been mentioned, numeric and scalar are not included. The one thing I

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Chris Stockton
On Thu, Apr 17, 2008 at 9:33 AM, Stanislav Malyshev [EMAIL PROTECTED] wrote: Just for the record, I see absolutely no sense in strict type hints. While there might be some use cases when you want to save typing by having function convert the arguments instead of you doing it manually - there's

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! So: function foo($var) { if(!is_int($var)) { throw new exception('not int'); }} What's the use of such code? If $var is '1' and not 1, what's the use of throwing an exception and having to handle it later (basically by failing the task, since you don't know how to do foo() now) -

Re: [PHP-DEV] Win32 mail() issue and potential fix - needs better brains than me to verify solution.

2008-04-17 Thread Scott MacVicar
Hi Richard, The patch would fix it in this case but there is an underlying change that needs sorted. zend_ini_string()'s behaviour was changed to fix http://bugs.php.net/bug.php?id=42657 so that if the default value was NULL it would then return an empty string instead.

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! Your current implementation seems to be inconsistent with both itself and the rest of PHP. I hope this can be rectified before it is included. PHP is inconsisent enough without adding more. If you talk about consistency, you should remember that right now no function and no feature in

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! The problem with this is that there's not much point in converting the value. PHP will do that anyway, making this kind of pointless. There would be a point since PHP might convert to different type that you intended. Think of $foo = My age is $age. If $age is supposed to be int, then

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Chris Stockton
On Thu, Apr 17, 2008 at 9:57 AM, Stanislav Malyshev [EMAIL PROTECTED] wrote: What's the use of such code? If $var is '1' and not 1, what's the use of throwing an exception and having to handle it later (basically by failing the task, since you don't know how to do foo() now) - instead of just

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Pierre Joye
Hi Stanislav, On Thu, Apr 17, 2008 at 7:02 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: Hi! Your current implementation seems to be inconsistent with both itself and the rest of PHP. I hope this can be rectified before it is included. PHP is inconsisent enough without adding more.

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! Please try to minimize redundant response (at least within 15 mins). I think we all got that you are against type hints in PHP, that's plain Against strict type hints, yes. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 10:06 -0700, Chris Stockton wrote: On Thu, Apr 17, 2008 at 9:57 AM, Stanislav Malyshev [EMAIL PROTECTED] wrote: What's the use of such code? If $var is '1' and not 1, what's the use of throwing an exception and having to handle it later (basically by failing the

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 10:06 -0700, Stanislav Malyshev wrote: Hi! The problem with this is that there's not much point in converting the value. PHP will do that anyway, making this kind of pointless. There would be a point since PHP might convert to different type that you intended.

Re: [PHP-DEV] Win32 mail() issue and potential fix - needs better brains than me to verify solution.

2008-04-17 Thread Jani Taskinen
On Thu, 2008-04-17 at 17:59 +0100, Scott MacVicar wrote: Hi Richard, The patch would fix it in this case but there is an underlying change that needs sorted. zend_ini_string()'s behaviour was changed to fix http://bugs.php.net/bug.php?id=42657 so that if the default value was NULL it

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Chris Stockton
On Thu, Apr 17, 2008 at 10:11 AM, Sam Barrow [EMAIL PROTECTED] wrote: Actually, is_numeric checks for strings that contain numeric values, it's not the same as is_bool, is_int, is_float, etc, which check the variable's type. Hence my second example = ) Your point is very valid for is_int

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 10:23 -0700, Chris Stockton wrote: On Thu, Apr 17, 2008 at 10:11 AM, Sam Barrow [EMAIL PROTECTED] wrote: Actually, is_numeric checks for strings that contain numeric values, it's not the same as is_bool, is_int, is_float, etc, which check

Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Felipe Pena
Em Qui, 2008-04-17 às 12:31 -0400, Sam Barrow escreveu: On Thu, 2008-04-17 at 09:18 -0700, Chris Stockton wrote: On Thu, Apr 17, 2008 at 9:01 AM, Sam Barrow [EMAIL PROTECTED] wrote: I like this alot better too, the only downside is compatibility problems. Can you explain, I

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Derick Rethans
On Thu, 17 Apr 2008, Felipe Pena wrote: Now with both parameter and return value type hints. For parameter type hints, i have completed the actual implementation with the leftover php types: - string (binary string and unicode) - integer (accepting numeric string too) - double (accepting

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Derick Rethans
On Thu, 17 Apr 2008, Felipe Pena wrote: Em Qui, 2008-04-17 às 17:17 +0200, Paul Biggar escreveu: Hi Felipe, Thanks for making the change. This is much more consistent. It remains that there is no 'scalar' or 'numeric' hint. Are you planning on including them? No, i'm not planning

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
I understand it very well, but why have a whole other system of type It's the same system. The same system that makes internal functions work. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Brian Moon
Derick Rethans wrote: I don't think scalar is very useful, but I do think there is a case for numeric. I don't think string is useful. I would use scalar instead. I only need to know that the variable is not an array or object. I can echo, concatenate, etc. any scalar as if it was a

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Brian Moon
I just did a grep on zend framework for is_int and there were tons of results. No offense to Zend, I love thos guys, but I don't think using Zend Framework as the gold standard for how people want to code in PHP is the right thing to do. -- Brian Moon Senior Developer/Engineer

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
On Thu, Apr 17, 2008 at 7:02 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: Your current implementation seems to be inconsistent with both itself and the rest of PHP. I hope this can be rectified before it is included. PHP is inconsisent enough without adding more. If you talk about

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! Seeing how you work for zend I thought maybe you have used the zend framework = ) Sorry in my example I used int instead of numeric, but my point is the same, grep in zend framework for is_bool. It might come as a surprise to you, but I did not write whole Zend Framework personally :)

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
Hi Stanislav, On Thu, Apr 17, 2008 at 7:59 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: As a final shock, I am not convinced functions in PHP should throw exceptions when parameters don't match - and even if they do, first they should attempt to make sense of parameters (which makes

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Chris Stockton
On Thu, Apr 17, 2008 at 10:59 AM, Stanislav Malyshev [EMAIL PROTECTED] wrote: Hi! Seeing how you work for zend I thought maybe you have used the zend framework = ) Sorry in my example I used int instead of numeric, but my point is the same, grep in zend framework for is_bool. It might

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Jarismar Chaves da Silva
I like and will use it a lot... sometimes you simple cannot trust on php dynamic type convertion, please see the following example ?php function check_user($user_id) { if ($user_id == 0) { // root user } else if ($user_id 0 $user_id 1000) { // special admin users } else {

[PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend.c zend_execute_API.c zend_vm_def.h zend_vm_execute.h php-src NEWS

2008-04-17 Thread Derick Rethans
On Thu, 17 Apr 2008, Dmitry Stogov wrote: Another idea: In case xdebug overwrites zend_execute() it can set EG(return_value_ptr_ptr) to point to some local variable then call original executor and then print pass return_value to caller or destroy it dependent on previous value of

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! If you talk about consistency, you should remember that right now no function and no feature in PHP relies on strict checking of primitive types. That is not the case (or I am very much mistaken). In particular, is_int, which I mentioned in my email, is predicated on the IS_LONG type

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
Hi, On Thu, Apr 17, 2008 at 8:22 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: If you talk about consistency, you should remember that right now no function and no feature in PHP relies on strict checking of primitive types. That is not the case (or I am very much mistaken). In

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! is_* are the important functions, since they are the ones which most resemble the type hints under discussion. Up until now, anyone Circular argument here. implementing this in user-land would use is_int(). It makes perfect No, you shouldn't do that - there's absolutely no reason to

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! Scalar is useful if you DON'T want an array or object - but don't care if you get an int/string/whatnot When you can use string but not object with __toString? -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED]

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Mark van der Velden
Derick Rethans wrote: On Thu, 17 Apr 2008, Felipe Pena wrote: Now with both parameter and return value type hints. For parameter type hints, i have completed the actual implementation with the leftover php types: - string (binary string and unicode) - integer (accepting numeric string too) -

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
I think that the typehints should be strict, if you don't want strictness, don't use type hints. Note that right now we already have non-strict typehints in most of the internal functions, so you *are* using them if you use PHP. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED]

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Sam Barrow
On Thu, 2008-04-17 at 11:43 -0700, Stanislav Malyshev wrote: Hi! Scalar is useful if you DON'T want an array or object - but don't care if you get an int/string/whatnot When you can use string but not object with __toString? my patch does that -- Stanislav Malyshev, Zend Software

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Pierre Joye
On Thu, Apr 17, 2008 at 8:41 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: Circular argument here. No comment. Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Stanislav Malyshev
Hi! When you can use string but not object with __toString? my patch does that Ok, that's great. So then it makes sense to allow converting int-string too, right? And then it'd also make sense to allow string-int too? Especially if we have object-int convertor and that can be allowed too.

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
On Thu, Apr 17, 2008 at 8:41 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: is_* are the important functions, since they are the ones which most resemble the type hints under discussion. Up until now, anyone Circular argument here. Yes, I phrased that badly. I believe it is fair to say

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Paul Biggar
On Thu, Apr 17, 2008 at 9:04 PM, Stanislav Malyshev [EMAIL PROTECTED] wrote: In fact, we have good old conversion system used in parse_parameters. So why not use the same rules? That'd make at least some sense - give PHP programmers the tools that extension C programmers have. I still

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Lars Strojny
Hi Felipe, first of all, thanks for your proposal. I like it. Am Donnerstag, den 17.04.2008, 11:42 -0300 schrieb Felipe Pena: Hi. Well, thinking better about the behavior of type hinting, i decided to change the proposal for strict type. I.e. don't accept numeric string as an intenger,

Re: [PHP-DEV] [RFC] Type hints (parameter and return value)

2008-04-17 Thread Jarismar Chaves da Silva
+1 Derick Rethans wrote: On Thu, 17 Apr 2008, Felipe Pena wrote: Now with both parameter and return value type hints. For parameter type hints, i have completed the actual implementation with the leftover php types: - string (binary string and unicode) - integer (accepting numeric string

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-04-17 Thread Felipe Pena
Em Qui, 2008-04-17 às 23:14 +0200, Lars Strojny escreveu: Hi Felipe, first of all, thanks for your proposal. I like it. Am Donnerstag, den 17.04.2008, 11:42 -0300 schrieb Felipe Pena: Hi. Well, thinking better about the behavior of type hinting, i decided to change the proposal for