I noticed that since PHP 7.0, I can use syntax like this:
<?php
["a", "b"]();
When I run it, I encounter the following error:
Fatal error: Uncaught Error: Class 'a' not found in ...
It seems that the PHP interpreter tries to resolve [“a”, “b”] as a reference to a class a with a method b and attempts to invoke it.
- Why does PHP interpret this array in this way?
- What is the underlying mechanism behind this behavior?
- Is there any official documentation or resources that explain this feature?