My PHP code looks pretty much identical to my code in other languages. Everything is in namespaces and classes. There is abstractions for database access and other common operations. I don't think PHP needs an expert mode; it just needs to continue to be a better language.
However, I agree, all languages should have the ability to turn off the backwards compatibility crud with some kind of statement. In PHP, it would be great to do that at the namespace level -- allowing different libraries to operate at different levels of support/strictness in the same project.
I've used PHP a lot, work at a name-brand startup that uses a fair bit of PHP in the stack, and have an OSS PHP project I'm proud of (https://github.com/shaneharter/PHP-Daemon). That is to say, I'm not a PHP hater. I see many flaws in the language, many many actually, but I'm not a hater.
But I wonder if maybe you're blind to the ways your PHP is different. Dozens of modules and hundreds of functions come directly with the language core. And very very esoteric stuff. Why does my programming language have a function to tell me specifically what day Easter is? Whaa? Why do I have to recompile my programming language to install new libraries? (PCNTL, for example).
If PHP is a salad bar, Python (for example) is prix fixe.
wget http://www.php.net/get/php-5.3.16.tar.gz/from/us2.php.net/mirror -O php-5.3.16.tar.gz
tar zxvf php-5.3.16.tar.gz
cd php-5.3.16/ext/pcntl
phpize
./configure
make
sudo make install
At this point you should see a pcntl.so in your extension_dir. Add an extension=pcntl.so to your php.ini file and you are good to go.
Of course with non-bundled extensions from pecl or github you can skip the tarball step.
That's no less omplicated than downloading the PHP source and recompiling with the --with-pcntl flag. Now compare that, just for your own wonderment, to how it works in other modern languages..
pip install package_name
or
gem install package_name
not to mention, with bundler and virtualenv you can easily, easily keep multiple versions of different packages for different projects without any juggling and hacking your way through.
Easily? I remember having quite some difficulties getting gems with binaries to work on Windows (meaning: lots of wrestling before I even got the MySql driver working). Might be different now though but I have never experienced anything like that when dealing with PHP extensions or Composer packages.
That is only because you picked an internal extension that is usually already built-in. If you install the php-cli package from any major distro it includes pcntl. For normal extensions you either do an apt-get install php-imap (for example) or a pecl install stem if your distro hasn't packaged the extension you need or you just prefer to install it directly.
You don't have to recompile PHP to install anything, PHP has loadable module and had them since forever. As for Easter - why do you care that there's a function for that? How does it hurt you? Somebody needed it, so it was added. Why having function that somebody needs and you do not is a problem?
However, I agree, all languages should have the ability to turn off the backwards compatibility crud with some kind of statement. In PHP, it would be great to do that at the namespace level -- allowing different libraries to operate at different levels of support/strictness in the same project.