Strict mode in PHP

Kind of. You can activate the E_NOTICE level in your error reporting. (List of constants here.) Every instance of usage of an undeclared variable will throw an E_NOTICE. The E_STRICT error level will also throw those notices, as well as other hints on how to optimize your code. error_reporting(E_STRICT); Terminating the script If you are … Read more

Redefinition allowed in C but not in C++?

Tentative definition is allowed in C but not in C++. A tentative definition is any external data declaration that has no storage class specifier and no initializer. C99 6.9.2/2 A declaration of an identifier for an object that has file scope without an initializer, and without a storage-class specifier or with the storage-class specifier static, … Read more

Has the new C++11 member initialization feature at declaration made initialization lists obsolete?

No, they are not obsolete as this article Get to Know the New C++11 Initialization Forms says in the Class Member Initialization section (emphasis mine): Bear in mind that if the same data member has both a class member initializer and a mem-init in the constructor, the latter takes precedence. In fact, you can take … Read more

Why are variables declared with their interface name in Java? [duplicate]

When you read List<String> list = new ArrayList<String>(); you get the idea that all you care about is being a List<String> and you put less emphasis on the actual implementation. Also, you restrict yourself to members declared by List<String> and not the particular implementation. You don’t care if your data is stored in a linear … Read more