Re: [PHP-DEV] [VOTE] declare(function_and_const_lookup='global')

This is only part of a thread. view whole thread
  108315
January 29, 2020 10:07 claude.pache@gmail.com (Claude Pache)
> Le 29 janv. 2020 à 09:55, Bishop Bettini <bishop@php.net> a écrit : > > Suppose I'm presented with this diff (and only this diff): > > $a = array_diff($x, $y); > + if (count($a)) die('Unexpected differences'); >
Realistically, when I see that diff, I assume that those functions are the well-known global ones. The eventual presence `declare(function_and_const_lookup='global')` directive would make my assumption provable, which is an improvement. In the rare cases where that my assumption is false, an explicit `use function MyNs\{array_diff, count}` is welcome (and is already possible) in order to make my assumption refutable without needing to look for improbable redefinition of those functions in other files; such an explicit declaration would be mandatory in presence `declare(function_and_const_lookup='global')`, which is an improvement. —Claude