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

From: Date: Wed, 29 Jan 2020 10:07:09 +0000
Subject: Re: [VOTE] declare(function_and_const_lookup='global')
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-108315@lists.php.net to get a copy of this message
> 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

« previous php.internals (#108315) next »