Doc #80149 [Com]: Mutually included files

[email protected] ("melindaetinw81 at gmail dot com") Wed, 30 Nov 2022 05:06:12 +0000
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=80149&edit=1

 ID:                 80149
 Comment by:         melindaetinw81 at gmail dot com
 Reported by:        marcio dot a dot siena at gmail dot com
 Summary:            Mutually included files
 Status:             Open
 Type:               Documentation Problem
 Package:            Documentation problem
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

I was impressed by your writing (https://www.mycfavisit.biz/)github.com


Previous Comments:
------------------------------------------------------------------------
[2020-09-26 22:25:13] marcio dot a dot siena at gmail dot com

Ok, thanks. Sorry for that.

Maybe add something like that:

- https://www.php.net/manual/en/function.require-once.php
- https://www.php.net/manual/en/function.include-once.php

"The script being requested by the user agent (browser) is considered an already included file, so include_once() and require_once() on it will have no additional effects. That can be veryfied by dumping the results of get_included_files()".

Thank you again.

------------------------------------------------------------------------
[2020-09-26 19:50:34] [email protected]

I wasn't telling you to ragequit. I was saying that

> So one must make tests to be sure about PHP's true behavior.

the current behavior is correct.

@danack asked you

> [The doc is] pretty clear to me. If you don't think it is, can you suggest where and how it should be documented?

Are you still willing to answer that?

------------------------------------------------------------------------
[2020-09-26 19:41:51] marcio dot a dot siena at gmail dot com

Ok, I will not argue.

If you have to do a get_included_files() instead of simply and clearly see it stated in the docs, so be it.

Thank you anyway.

Bye.

------------------------------------------------------------------------
[2020-09-26 19:38:32] [email protected]

The documentation does not say "...if the file has already been included by the use of include/require/include_once/require_once()".

The fact is that a1 was included at the beginning *by PHP*. And that counts. And if you dump get_included_files() inside a1 then you'll see a1 in the list of files.

------------------------------------------------------------------------
[2020-09-26 12:05:46] marcio dot a dot siena at gmail dot com

Hi.

Sorry if I was not clear.

The main file, a1.php, is the file *requested* by the browser.

Then it includes b1.php. Only THEN, from b1.php, a1.php (the originally requested file) is included/required.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=80149


--
Edit this bug report at https://bugs.php.net/bug.php?id=80149&edit=1