weak-typing

What does strict types do in PHP?

拟墨画扇 提交于 2019-11-27 00:19:11
问题 I've seen this new line in PHP7 but nobody really explains what it means. I've googled it and all they talk about is will you be enabling it or not like a poll type of thing. declare(strict_types = 1); What does it do? How does it affect my code? Should I do it? Some explanation would be nice. 回答1: From Treehouse blog : With PHP 7 we now have added Scalar types. Specifically: int, float, string, and bool. By adding scalar type hints and enabling strict requirements, it is hoped that more

Static/Dynamic vs Strong/Weak

混江龙づ霸主 提交于 2019-11-26 11:57:45
I see these terms bandied around all over the place in programming and I have a vague notion of what they mean. A search shows me that such things have been asked all over stack overflow in fact. As far as I'm aware Static/Dynamic typing in languages is subtly different to Strong/Weak typing but what that difference is eludes me. Different sources seem to use different meanings or even use the terms interchangeably. I can't find somewhere that talks about both and actually spells out the difference. What would be nice is if someone could please spell this out clearly here for me and the rest

Static/Dynamic vs Strong/Weak

两盒软妹~` 提交于 2019-11-26 02:25:52
问题 I see these terms bandied around all over the place in programming and I have a vague notion of what they mean. A search shows me that such things have been asked all over stack overflow in fact. As far as I\'m aware Static/Dynamic typing in languages is subtly different to Strong/Weak typing but what that difference is eludes me. Different sources seem to use different meanings or even use the terms interchangeably. I can\'t find somewhere that talks about both and actually spells out the

Is Python strongly typed?

跟風遠走 提交于 2019-11-26 01:36:49
问题 I\'ve come across links that say Python is a strongly typed language. However, I thought in strongly typed languages you couldn\'t do this: bob = 1 bob = \"bob\" I thought a strongly typed language didn\'t accept type-changing at run-time. Maybe I\'ve got a wrong (or too simplistic) definition of strong/weak types. So, is Python a strongly or weakly typed language? 回答1: Python is strongly, dynamically typed. Strong typing means that the type of a value doesn't change in unexpected ways. A