> Le 4 sept. 2019 à 13:54, Dan Ackroyd <dan...@basereality.com> a écrit : > >> >> if we were to use "?int" instead, the engine would force the >> community to add "return null;" > > That sounds like a bug to me. The fact that null is returned by any > function that lacks an explicit return value, is well-defined, and one > of the most underrated aspects of PHP imo. >
This is an aspect of the eternal debate between explicit vs. implicit. In another recent thread, another aspect, namely variable initialisation, was debated. There is no “correct” solution, as it pertains much to coding style. —Claude