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
, 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
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
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
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
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
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
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
hinting.
Tomi Kaistila
PHP Developer
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
and
implemented?
Tomi Kaistila
PHP Developer
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
)
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
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
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
being implemented?
Tomi Kaistila
PHP Developer
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
, 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
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
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
-1
Tomi Kaistila
PHP Developer
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
. 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
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
20 matches
Mail list logo