5
PHP 7 has launched a number of innovations for the PHP language. I even noticed that classes can now have keyword named methods. The strange thing is that classes cannot have, but methods can (see!)
For example, this is valid in PHP7:
class X{
public function foreach(array $array, \Closure $closure) : boolean {
}
}
My curiosity is, This is good or bad?
It is really an advantage to be able to declare the name of methods as being of a keyword?
What was the reason that PHP-7 included this new feature in the language, if it previously generated a Parse Error
?
It would look very strange
private function private() : boolean {}
– Wallace Maxters
@Wallacemaxters and the
public function function()
? :D– rray
Very nice to have mentioned this problem of
Laravel
, but this problem occurred in Laravel 3, and not in 4. In 4 the problem was already solved– Wallace Maxters
@Wallacemaxters then in the link that is the question he speaks of the 4, but I can edit without problems.
– rray
@Wallacemaxters leaves tomorrow after lunch to give someone time to answer :)
– rray