php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #2766 Better escaping leading to better code
Submitted: 1999-11-19 18:16 UTC Modified: 2000-07-31 22:17 UTC
From: ajr4 at lehigh dot edu Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0 Beta 3 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ajr4 at lehigh dot edu
New email:
PHP Version: OS:

 

 [1999-11-19 18:16 UTC] ajr4 at lehigh dot edu
	A feature that would greatly improve code layout is the so called macro entity.
	The reason we use HTML is because it is the easiest format that is directly related to the way we think of document layout. i.e. "Apply this format to this region", "insert this object here." When programmers make these documents dynamic, most of them tend to create a patchwork of code and HTML that no longer accurately represents the document layout it produces until after it is processed.
	Inline code tags were the first step in the right direction. They allow the code to be inserted into the document instead of vice versa. However inline code tags lead to certain common abuses i.e. something like <NAME ATTRIBUTE="<? print $value ?>">. This kind of abuse decreases readability by both humans and programs like a syntax highlighter in an editor and is agains the w3c spec.
	The next step that would further allow the programmer to preserve the layout structure without obfuscating the code is the addition of what are know as macro entities. The syntax is &{expr}; and is accepted by the w3c in their HTML 4.0 spec. They are already implemented to allow JavaScript macro entities and I believe PHP should adopt this form in addition to the inline code tags. The code &{expr}; would be semanticly equivalent to <? print expr ?>. This method also would have the added benefit of reducing the amount of code clutter for a very common operation - printing a value into the document.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-26 14:06 UTC] rasmus at cvs dot php dot net
Could you point me at something that says that this notation was intended for server-side scripting?
I dont see how we would be able to figure out whether such a tag would be intended to be a client-side JS tag vs. a server-side PHP tag.
 [2000-07-31 22:17 UTC] waldschrott@php.net
right, thus this one is closed
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 12:00:02 2026 UTC