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

Jorg Sowa <[email protected]> Tue, 4 Aug 2026 00:37:24 +0200
Newsgroups gmane.comp.php.devel
Message-ID <CAPTD5yHzddM2SoafE0oT4Trh36xQ8TV4WgczgvyPYkAiB3MCfA@mail.gmail.com>
--00000000000049f8f906582c2f43
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello internals,

Would this change be acceptable to merge without an RFC?

https://github.com/php/php-src/pull/22589

It adds =E2=80=9Cdid you mean =E2=80=A6?=E2=80=9D 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.

If the sentiment is positive, I would like to pursue this direction for
methods, classes, constants etc.

Similar approach is used in Python or Ruby already:

- Python: https://docs.python.org/3/whatsnew/3.10.html#nameerrors

- Ruby: https://docs.ruby-lang.org/en/3.3/DidYouMean.html
Kind regards,
Jorg

--00000000000049f8f906582c2f43
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><p class=3D"gmail-isSelectedEnd"><span>Hello internal=
s,</span></p><p class=3D"gmail-isSelectedEnd"><span>Would this change be ac=
ceptable to merge without an RFC?</span></p><p class=3D"gmail-isSelectedEnd=
"><a href=3D"https://github.com/php/php-src/pull/22589"><span>https://githu=
b.com/php/php-src/pull/22589</span></a></p><p><span>It adds =E2=80=9Cdid yo=
u mean =E2=80=A6?=E2=80=9D suggestions to errors for undefined functions. W=
hile it does not change language semantics, it changes error messages and i=
ntroduces additional checks on error paths, so I would like to confirm whet=
her consensus on the PR is sufficient or an RFC is expected.<br><br></span>=
</p><p><span>If the sentiment is positive, I would like to pursue this dire=
ction for methods, classes, constants etc.<br><br></span></p><p><span>Simil=
ar approach is used in Python or Ruby already:<br></span></p><p><span>- Pyt=
hon:=C2=A0</span><a href=3D"https://docs.python.org/3/whatsnew/3.10.html#na=
meerrors">https://docs.python.org/3/whatsnew/3.10.html#nameerrors</a><br></=
p><p>- Ruby:=C2=A0<a href=3D"https://docs.ruby-lang.org/en/3.3/DidYouMean.h=
tml">https://docs.ruby-lang.org/en/3.3/DidYouMean.html</a></p>Kind regards,=
<br></div>Jorg</div>

--00000000000049f8f906582c2f43--