Re: [PHP-DEV] Suggest similar names for undefined function/method/class errors

Matteo Beccati <[email protected]> Tue, 4 Aug 2026 11:04:44 +0200
Newsgroups gmane.comp.php.devel
Message-ID <[email protected]>
Hi,

Il 04/08/2026 09:55, Sjoerd Langkemper ha scritto:
> Hello Jorg,
> 
> On Tue, Aug 4, 2026, at 00:37, Jorg Sowa wrote:
>>
>> “did you mean …?” suggestions to errors for undefined functions. While 
>> it does not change language semantics, it changes error messages and 
>> introduces additional checks on error paths, so I would like to 
>> confirm whether consensus on the PR is sufficient or an RFC is expected.
>>
> 
> Thanks, this is great.
> 
> According to PHP Policy RFC: Exempt input type and value validation from 
> BC Break policy <https://wiki.php.net/rfc/policy-exempt-type-value- 
> error-bc-policy>, rephrasing error messages is not subject to the 
> backwards compatibility break policy.

We are very close to the soft feature freeze. I'm looking forward to 
hearing some feedback on the list.


> I think the amount of punctuation at the end is a bit much. Perhaps it 
> would be clearer (although less strictly correct) to say "(did you mean 
> func?)" instead of "(did you mean func()?)". But either way I am in 
> favor of this.

I do agree here there's a bit too much punctuation. Perhaps something 
similar to what Python does (according to the posted link)?

Call to undefined function defined(). Did you mean: define?


Cheers
-- 
Matteo Beccati