doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

Unreferenced Class names

Open wijnandus opened this issue 1 year ago • 2 comments

From manual page: https://php.net/language.namespaces.importing

---The examples shown do not work unless the php file that contains the references is 'required' is also loaded. Why is there no mention of this? Just running the examples always gives me "Fatal error: Uncaught Error: Class 'My\Own\Classname' not found in..... on line nnn Regards, Winand Beke

wijnandus avatar Aug 21 '24 06:08 wijnandus

Maybe we should explicitly state that these examples are for understanding purposes only, and not actually meant to be executed. Perhaps we should even mark them ("machine readable"), considering that at some point in the future we may want to add the possibility to actually run examples from the online manual.

cmb69 avatar Aug 21 '24 10:08 cmb69

Dear Mr Becker,

Thank you or your prompt reply. But I have still one doubt. Since there is no line in the example program that 'requires' a certain php file to be included, I thought that perhaps this may require certain settings in the php configuration file to always preload a number of files that contain class definitions, and that that was the reason for this not showing up in the example.

The problem is that my AI copilot in Edge at first also thought that it was not necessary to include 'require' statements, because it probably get its wisdom from these php manuals

Anyway, thanks again for your prompt reply

Regards,

Wijnand Beke

From: "Christoph M. Becker" @.> To: "php/doc-en" @.> Cc: "wijnand beke" @.>, "Author" @.> Sent: Wednesday, 21 August, 2024 13:54:48 Subject: Re: [php/doc-en] Unreferenced Class names (Issue #3667)

Maybe we should explicitly state that these examples are for understanding purposes only, and not actually meant to be executed. Perhaps we should even mark them ("machine readable"), considering that at some point in the future we may want to add the possibility to actually run examples from the online manual.

— Reply to this email directly, [ https://github.com/php/doc-en/issues/3667#issuecomment-2301762858 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/ALJHFHNUXYICZB2SVYMDJCDZSRWXRAVCNFSM6AAAAABM3JMHD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBRG43DEOBVHA | unsubscribe ] . You are receiving this because you authored the thread. Message ID: <php/doc-en/issues/3667/2301762858 @ github . com>

wijnandus avatar Aug 21 '24 11:08 wijnandus