Hi!
It is foolish to think that these two bits of code are behaviorally different:
class Entity {
DateTime $last_modified;
}
The are different because this one looks like a strongly typed variable
which brings with it a lot of connotations which aren't immediately
obvious, and in fact
On Tue, Oct 16, 2012 at 11:58 AM, Stas Malyshev smalys...@sugarcrm.com wrote:
Type hinting in parameters is a really good thing, and it doesn't
transformed PHP in a strongly typed language.
It however gave a permission to people to try sneak in strong-typedness
through various backdoors
On Mon, Oct 15, 2012 at 2:11 PM, Clint Priest cpri...@zerocue.com wrote:
So the above would actually introduce an get/set accessor rather than a
property, correct?
Preferably it would a faster C based implementation for the check, but
in principle it could also use accessors to achieve the goal.
On Tue, Oct 16, 2012 at 12:55 PM, Stas Malyshev smalys...@sugarcrm.com wrote:
Last thing: I agree with Clint and you. If it was early checked, it
would be better. But the current type hinting is far better than nothing
at all. Yes, we can't lint it, but it was pretty useful a big number
No,
Hi!
I see this argument crop up with every typehint discussion and just
don't understand it at all. Why would you want to check the variable
type everywhere? You just assign it and if it doesn't work, then you
get an error. Just like it should be. I mean, do you seriously check
No, you don't
On Wed, Oct 17, 2012 at 1:07 PM, Stas Malyshev smalys...@sugarcrm.com wrote:
I see this argument crop up with every typehint discussion and just
don't understand it at all. Why would you want to check the variable
type everywhere? You just assign it and if it doesn't work, then you
get an
2012/10/17 Stas Malyshev smalys...@sugarcrm.com
No, you don't get an error. You'd get an error in compiled language. In
dynamic language, your client gets an error when his site is launched
and instead of happy launch his users get white screens. To avoid that,
you'd need to add checks - or
Hi!
public DateTime $date;
This is *real* progress, even if under the hood all it does is wrap
I think it's a movement in wrong direction. Again, it is an attempt to
make PHP a strongly typed language, which would not work well in a
dynamic language like PHP, for reasons that were amply
2012/10/16 Stas Malyshev smalys...@sugarcrm.com
public DateTime $date;
This is *real* progress, even if under the hood all it does is wrap
I think it's a movement in wrong direction. Again, it is an attempt to
make PHP a strongly typed language, which would not work well in a
dynamic
Hi!
Not necessarily strongly typed. (sorry to land on this topic afterwards)
As I see PHP, it's a language that can be used as an informal scripting
language, but also as a rock-solid modern tool.
I have no idea what rock-solid modern tool means, though PHP is
trivially a modern tool by being
Hi!
Not necessarily strongly typed. (sorry to land on this topic afterwards)
As I see PHP, it's a language that can be used as an informal scripting
language, but also as a rock-solid modern tool.
I have no idea what rock-solid modern tool means, though PHP is
trivially a modern tool by being
[mailto:smalys...@sugarcrm.com]
Sent: Tuesday, October 16, 2012 4:58 AM
To: Amaury Bouchard
Cc: Levi Morrison; Clint Priest; internals@lists.php.net; Nikita Popov
(nikita@gmail.com)
Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 : Typehints /
Accessor Syntax
Hi
2012/10/16 Stas Malyshev smalys...@sugarcrm.com
Also, the fact is that other dynamic languages do not
have strong typing. It may be they just aren't smart enough to recognize
everybody needs it - or there may be a reason why it doesn't happen. I
think there is a reason
Doing the same for
Hi!
If the first could be useful, the second could be useful too. Or you are
saying that parameters type hinting was a bad idea?
Given how it is understood now - as a first step to make PHP a strongly
typed language - yes, I'm starting to think it was. If it was understood
as it was intended -
On 10/16/2012 02:51 AM, Amaury Bouchard wrote:
2012/10/16 Stas Malyshev smalys...@sugarcrm.com
public DateTime $date;
This is *real* progress, even if under the hood all it does is wrap
I think it's a movement in wrong direction. Again, it is an attempt to
make PHP a strongly typed
2012/10/16 Rasmus Lerdorf ras...@lerdorf.com
The rule in PHP for any sort of type hinting is that it is only done for
non-coercable types. In cases where there is simply no way to recover
from passing the wrong type, it is good to catch it as early as
possible. Extending this to also cover
On Tue, Oct 16, 2012 at 10:31 AM, Amaury Bouchard ama...@amaury.net wrote:
2012/10/16 Rasmus Lerdorf ras...@lerdorf.com
The rule in PHP for any sort of type hinting is that it is only done for
non-coercable types. In cases where there is simply no way to recover
from passing the wrong type,
* I'm moving this into its own mail thread because talking about 5 different
topics under the same chain is ridiculous (has anyone suggested forums instead
of email??)
So here comes my round of feedback on the current proposal.
But before getting to that: I have collected a bit of data
public DateTime $date;
This is *real* progress, even if under the hood all it does is wrap
functions and use function type-hints. This piece of code is SO much
shorter and cleaner. Will it be a bit confusing to new developers?
Maybe, but I don't care. It is not aimed at making the lives of new
19 matches
Mail list logo