Re: Ruminations on PHP 5++

From: Date: Fri, 24 Jan 2014 20:14:04 +0000
Subject: Re: Ruminations on PHP 5++
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-71525@lists.php.net to get a copy of this message
PHP is and should remain: 1) a pragmatic web-focused language 2) a loosely typed language 3) a language which caters to the skill-levels and platforms of a wide range of users The web is not typed. If we are going to expand the type checking we have to respect type coercion. If people can no longer do: age_check($_POST['age']) because age_check is defined as: function age_check(int $age) { } then we have a problem. This is why PHP doesn't have type checks for coercible types, of course. Many suggestions I have seen so far use the friendly-sounding "type hint" term to introduce strict typing. They aren't hints at all in those implementations. It doesn't mean we can't do something here, but it has to be done very carefully. And rather than piling on language features with the main justification being that other languages have them, I would love to see more focus on practical solutions to real problems. The password_hash() addition in 5.5 is a good example of addressing a real Web problem. PDO could use some attention. For example, I've been looking at PDO-mysqlnd and mysqli-mysqlnd and trying to get them to share the underlying mysqlnd connection. Why? Because PDO has a very nice client-side prepare implementation which saves 2 network roundtrips per query over doing them server-side. But, at the same time mysqli has some very nice low-level features people would love to have access to. Being able to export the underlying PDO connection to the native API across all the drivers would be a significant improvement. Performance is always interesting. There are plenty of places where we can get some performance wins, especially through tighter integration with opcache. Unicode Unicode Unicode. And yes, I know these are much harder and less sexy than adding a couple of tokens to the yacc grammar, but when we start looking at a new major release this is what I hear from people who are running PHP in production environments are looking for. Language features are nice, if they are well thought out, but significant infrastructure improvements are nicer. -Rasmus

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#71525) next »