Re:What I Like About PHP
by Shish2k on Tuesday December 09, 2014 @09:00PM
(#8727260)
> One of my favorite features is type enforcement
... that's a feature that pretty much every other language either already has (and does better), or explicitly does something different (but better) :S
Specifically, every other langage that I know of with type checking support has type checking for classes and primitives. PHP, not so much:
function test(integer $z) {
print $z + 1;
}
test(42);
PHP Catchable fatal error: Argument 1 passed to test()
must be an instance of integer, integer given
... that's a feature that pretty much every other language either already has (and does better), or explicitly does something different (but better) :S
Specifically, every other langage that I know of with type checking support has type checking for classes and primitives. PHP, not so much: