DEV Community

Discussion on: PHP needs its own ES6

Collapse
 
deathshadow60 profile image
deathshadow60

Whilst I have my own list of changes that would improve PHP, and I heartily agree over how derpy PHP's naming conventions are, some of what you said doesn't feel like improvements to me.

The daisy chained "building" methdodology of ->something->somethingElse always strikes me as painfully and agonizingly cryptic, and for what? "Wah wah, eye dunz wunna type?". PHP thanks to its C syntax is already painfully and agonizingly cryptic enough without making it HARDER to understand. One of the many reasons I'm not a fan of jQuery and often call it mentally enfeebled half-witted trash.

Things I'd like to see?

No more shorttags, EVERYTHING is code and nothing is allowed to blindly output.

No more heredoc, nowdoc, or double quoted strings. Single quotes or golf tango foxtrot oscar.

Make all "include" be require. The myth of overhead difference is BS and it would cause a fundamental shift in how people write PHP.

No passing scope to includes. BREAK SCOPE.

No more direct execution inside includes, make everything in an include HAVE to be an object or function method like any other normal library.

Make includes filetype be a trigger to NOT allow the file to be opened for read/write from PHP itself. That means no fopen, no readfile, nothing OTHER than including it for execution.

These might all sound odd, but do you realize how many PHP cracks/exploits would have fallen flat on their faces with these changes?

But what do I know? My first step after RCA 1802 and 8080/Z80 Machine Language was Pascal, and I spent a decade programming ADA. "C is not my favorite language"