[PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
be enforced. After all the user of my library has the option to dump it and go for another library that does not force types. That is the beauty of having options. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
, for the simple fact that they are ignore by a major portion of PHP developers and to use them would prompt a high risk of people writing bad code. Also, now that you mentioned abstract classes, type hinting might also be useful with interfaces. Tomi Kaistila PHP Developer On Thursday 03

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
management, instead of competing with it. I say use E_WARNING at this stage. If there is some large redecorating with PHP's error handling in the future, it can be changed then. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
a PHP developer. That's not what I am hearing here on the list. I did not get this comment. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
you not paying attention? Having the type hinted on the function declaration saves me the time and energy of checking the type myself, which is something I have to do quite often. It, of course not, remove the need to validate your arguments completely. But it would be a big help. Tomi Kaistila

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
So, can we switch the mundane conversation from should we have type hinting to why don't we have scalar type hinting if we have non-scalar type hinting? That is the real conversation. Type hinting is here. It is not going anywhere. Let's finish the job. Amen. Tomi Kaistila PHP Developer

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
upon discovering a bug, potentially in production use) he notices that both X and Y happened. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
not invalidate the need for either feature. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Tomi Kaistila
hinting. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-04 Thread Tomi Kaistila
and implemented? Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] type hinting

2008-01-08 Thread Tomi Kaistila
) if(! empty($input)) { doSomething($input); } This seems like a perfectly logical division of labor. The validator validates and casts and the library class acts on the proper input. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] type hinting

2008-01-08 Thread Tomi Kaistila
do not use type hinting at all in that case. I say, do it properly or do not do it at all. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] type hinting

2008-01-08 Thread Tomi Kaistila
this feature that was limited by adding a seemingly useful attribute to it, but in the end still leaving the feature limited and not really fixing anything. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Set default namespace

2008-01-09 Thread Tomi Kaistila
being implemented? Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Set default namespace

2008-01-10 Thread Tomi Kaistila
, in PHP, the concept of packages only exists in documentation. Tomi Kaistila PHP Developer On Thursday 10 January 2008 11:42:29 you wrote: use ProjectA; is equivalent of use ProjectA as ProjectA; if you want to use something from namespace you should use that something. for example: use

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Tomi Kaistila
Well if confusing is the goal, then yes, since this is classic Perl. I started using PHP, instead of Perl, just so that I would not need play around with confusing syntax. Tomi Kaistila PHP Developer On Thursday 10 January 2008 15:56:54 Hannes Magnusson wrote: So you reject scalar type

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Tomi Kaistila
except instead of square brackets use round brackets. $a = (1, 2, 3, 4, 5); $a = (1 = 'dharma', 2 = 'wilma'); This would be consistent with the old way of assigning array values and will probably least confuse both new and old developers. Tomi Kaistila PHP Developer -- PHP Internals - PHP

Re: [PHP-DEV] Re: Array syntax []

2008-01-11 Thread Tomi Kaistila
-1 Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] SUMMARY: Array syntax

2008-01-12 Thread Tomi Kaistila
. There is nothing wrong with that. In my opinion, it only makes it clear and easy to catch when you are reading code (particularly that which someone else wrote). Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] type hinting

2008-02-06 Thread Tomi Kaistila
but that will all be just extra. For me, it is more important to have the basic primitive types (i.e. integer, boolean, etc.) than having generic ones like 'object' or 'scalar'. Tomi Kaistila PHP Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http