The same language on the server and the client
This is not only a matter of simplicity or ease of learning. It is a fact that moving from one language to another facilitates the occurrence of errors, but the advantage of the unique language goes beyond. This allows to transfer at your choice the processing to the client or the server. Exactly the same functions with the same libraries.
We can choose to place the code on the client to alleviate the server load because the customer has unused resources. Instead we may transfer code on the server to protect the source if we own it, or to reduce the loading time by sending only the results to the client.
Performances (comparing Node.js and PHP)
The difference is certainly reduced with Facebook's HHVM, a JIT virtual machine. But this is not the PHP that we find on all servers.
Unlimited libraries without compilation
The number of libraries that can be included in a project, including from GitHub, is an advantage. They can be written in any language (export instructions are just added) and linked to JS with the require command .
PHP also allows you to link libraries written in C, but we must ask the user to enable the extension in the INI file which is unacceptable for distribution when users are not programmers.
Dynamic web application
If you want to use a content manager for a portal or blog, PHP remains irreplaceable. There are managers in JS, but they are not at the level of Wordpress or Drupal. On the other hand, for an online application, there are frameworks made to HTML. For example Angular, Ember, which offers bi-directional data-binding.
The difference is that the CMS sees HTML as a code to produce, and frameworks as an interface with which to interact.
Thus, while the CMS in PHP is suitable for editorial contents, for an original application with new features a framework provides more freedom.
Offline and mobile
I've never seen a Wordpress or Joomla site working in offline mode. In theory, a PHP program can run on the client, such as Java applets (this is not a good reference), but that assumes that a PHP interpreter is present. This limitation does not exist for JS, it is present on all computers in the browser.
The offline mode is particularly welcomed on mobile devices, to avoid time-consuming loading at each session but also to save bandwidth that is limited on these devices.
In conclusion, the LAMP model (Linux, Apache, MySQL, PHP) was developed and popularized in the era of computers and office software and a web of static pages, albeit supplemented by Ajax, but it is only a patch of dynamics on a static system.
It is not necessarily optimal for the current devices, mobile, online applications also running offline.
Updated Mai 11, 2013. Amended paragraph about libraries.
Following comments from users, I have to clarify something. PHP had a dl command to include external libraries that has been removed since version 5.3. And also include or require command to includes other PHP sources in the current file.
The require command of Node.js allows to link the programm to external libraries in JS or another language, it does not compare.
Updated May 13, 2013: After reading the comments of readers here and on HN, I realize that in fact, the advantage of JS over PHP is not in the list of features, but in experience they provide instead. I made some online applications in PHP (whatever one could thinks), and I now regret not having used JS and Node instead, because it would have been very much simpler and the result better. This was the reason for this article and it will need more details in the future.