On Thu, Jul 1, 2021 at 3:05 PM Hamza Ahmad <office.hamzaah...@gmail.com>
wrote:

> Hi all,
>
> While I was reading through the discussion, I found a question related
> to the conflict of constant names and functions names. In other words,
> `strlen` can be both a constant name and a function name.
>

This was stated before but, basically, the idea is that the difference
between a constant and function or between the property and the method (or
class constant and static method) is done on the usage side, if a calling
syntax is encountered.
$a = strlen; // reading the constant
$a = strlen(); // calling the function
$a = $this->run; // reading the property
$a = $this->run(); // calling the method
$a = Clazz::operation; // reading the static property (or enum case)
$a = Clazz::operation(); // calling the static method

This way of identifying it is something embedded in the language and
probably not that easy to avoid.
This is why the syntax is similar to a method call, to properly identify
the callable without other new syntax.

Alex

Reply via email to