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

2020-01-30 Thread Guilliam Xavier
> declare(strict_qualify=1); > > namespace foo; > > use function \{array_diff, var_dump}; > use const \bar\{a, b}; [Off-topic] All coding standards I've seen forbid writing a leading backslash in "use" and in strings. Indeed, `use \Ns\Klass;` gives the false impression that the leading backslash

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

2020-01-30 Thread Claude Pache
> Le 29 janv. 2020 à 22:11, Bishop Bettini a écrit : > > On Wed, Jan 29, 2020 at 3:12 PM Claude Pache > wrote: > > >> Le 29 janv. 2020 à 19:42, Bishop Bettini > > a écrit : >> >> Cons... have to enumerate everything, potentially lots of

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

2020-01-29 Thread tyson andre
> Agreed. I want to force explicit qualifications, and raise error on > unqualified names: > > declare(strict_qualify=1); > > namespace foo; > > use function \{array_diff, var_dump}; > use const \bar\{a, b}; > > $x = array_diff(a, b); > if (count($x)) { // throw an \Error of some kind, as count

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

2020-01-29 Thread Bishop Bettini
On Wed, Jan 29, 2020 at 3:12 PM Claude Pache wrote: > > > Le 29 janv. 2020 à 19:42, Bishop Bettini a écrit : > > Cons... have to enumerate everything, potentially lots of work to do that > to update old code to use; edge cases I'm not thinking about. > > > Not only it is much work (although it

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

2020-01-29 Thread Claude Pache
> Le 29 janv. 2020 à 19:42, Bishop Bettini a écrit : > > Cons... have to enumerate everything, potentially lots of work to do that > to update old code to use; edge cases I'm not thinking about. Not only it is much work (although it could be partially automated), but it does not make much

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

2020-01-29 Thread Bishop Bettini
On Wed, Jan 29, 2020 at 5:56 AM Marco Pivetta wrote: > I voted "No" on this one, sorry. > > TL;DR: I'd rather have a mechanism to disable global function fallback, not > something that makes un-imported symbols immediately global. > > The idea to disable PHP's implicit >

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

2020-01-29 Thread Marco Pivetta
Hey Tyson, I voted "No" on this one, sorry. TL;DR: I'd rather have a mechanism to disable global function fallback, not something that makes un-imported symbols immediately global. The idea to disable PHP's implicit "fallback-to-something-that-may-or-may-not-exist" is great, and it could

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

2020-01-29 Thread Claude Pache
> Le 29 janv. 2020 à 09:55, Bishop Bettini 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

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

2020-01-29 Thread Lynn
On Wed, Jan 29, 2020 at 9:55 AM Bishop Bettini wrote: > Notwithstanding the excellent work done in the PR, I lean toward a No vote. > > Suppose I'm presented with this diff (and only this diff): > > $a = array_diff($x, $y); > + if (count($a)) die('Unexpected differences'); > > Where does count

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

2020-01-29 Thread Bishop Bettini
On Tue, Jan 28, 2020 at 9:22 PM tyson andre wrote: > > I've opened the vote on https://wiki.php.net/rfc/use_global_elements > after weighing the pros and cons of discussed alternative approaches. > Yesterday, I've finished the last set of updates I announced I would do > based on RFC feedback. >

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

2020-01-28 Thread tyson andre
Hi internals, I've opened the vote on https://wiki.php.net/rfc/use_global_elements after weighing the pros and cons of discussed alternative approaches. Yesterday, I've finished the last set of updates I announced I would do based on RFC feedback. (that update was to require the statement 'use