php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30506 Symbolic Includes
Submitted: 2004-10-21 02:42 UTC Modified: 2004-11-17 01:00 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: rintaun at projectxero dot net Assigned:
Status: No Feedback Package: Feature/Change Request
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rintaun at projectxero dot net
New email:
PHP Version: OS:

 

 [2004-10-21 02:42 UTC] rintaun at projectxero dot net
Description:
------------
Requesting symbolic includes, as opposed to standard text includes.

Symbolic includes are so much cleaner than text includes, and would make developing some applications in PHP much easier.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-21 09:17 UTC] derick@php.net
What are symbolic includes?
 [2004-11-09 09:45 UTC] rintaun at projectxero dot net
PHP uses text includes, ie. it simply replaces the include() call with the file that is being included. However, symbolic includes are included.. well, symbolically.
 [2004-11-09 10:10 UTC] tony2001@php.net
Personally I can't understand what are you talking about.
 [2004-11-09 13:11 UTC] derick@php.net
And me neither...
 [2004-11-09 14:34 UTC] rakaur at malkier dot net
Symbolic includes import the symbol table for the given namespace into the current namespace (such as in Python, Perl, D, Ruby, Java, etc) instead of textually replacing the include call with the file's contents. You more commonly see this used with `import` rather than `include`.

Since PHP has no notion of namespaces or cleanliness (it just throws everything into one big namespace) I don't see how this would be accomplished without some semi-large changes to the way the language works.

Perhaps something like Perl's `use` (which imports the namespace into the current namespace, but doesn't do a textual include) versus Pelr's `require` (which requires you to access the namespace seperately via `$Namespace::`).

Another way to compare/contrast would be Python's `import' versus `from <something> import <something`. The former requires the use of a new namespace, the latter imports symbols into the current namespace.

I hope that answers some questions.
 [2004-11-09 14:45 UTC] derick@php.net
Sure, but PHP already does that. It does not do anything with importing text, it imports the symbols from the script that runs... I still don't get it here...
 [2004-11-09 23:28 UTC] rakaur at malkier dot net
If PHP already does that, then what he's asking for is likely namespaces.

I've always used PHP as a "quick hack" for some Web stuff; however, people producing non-Web programs and/or large-scale Web projects would probably appreciate something like namespaces to better organize.

Pretty much every major scripting language around has some concept of namespaces.

Of course, this could be worked around by wrapping classes around everything in included files, but that's not a true namespace.
 [2004-11-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC