rfc:linecontrol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rfc:linecontrol [2011/08/11 04:12] – created gwynnerfc:linecontrol [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * Date: 2011-08-11   * Date: 2011-08-11
   * Author: Gwynne Raskind <gwynne@php.net>   * Author: Gwynne Raskind <gwynne@php.net>
-  * Status: Draft+  * Status: Draft (Inactive)
   * First Published at: http://wiki.php.net/rfc/linecontrol   * First Published at: http://wiki.php.net/rfc/linecontrol
  
Line 69: Line 69:
  
   * Better identification of the location of error messages   * Better identification of the location of error messages
-  * More control over ''__FILE__'' and ''__LINE__'' macros+  * More control over ''<nowiki>__FILE__</nowiki>'' and ''<nowiki>__LINE__</nowiki>'' macros
   * Enables useful complex preprocessing   * Enables useful complex preprocessing
  
 === Con === === Con ===
  
-  * Interferes with HTML mode +  * Interferes with HTML mode? 
-  * Potential security implications for malicious manipulation of ''__FILE__''+  * Potential security implications for malicious manipulation of ''<nowiki>__FILE__</nowiki>''
   * Questionable interoperation with included files   * Questionable interoperation with included files
   * May only be useful for CLI applications   * May only be useful for CLI applications
Line 86: Line 86:
   - ''cat something.php | php -''   - ''cat something.php | php -''
   - In general, anything which may produce error-emitting PHP code whose source is not immediately accessible.   - In general, anything which may produce error-emitting PHP code whose source is not immediately accessible.
 +
 +===== Proposal =====
 +
 +The proposed syntax for linemarkers is identical to that used by the ''cpp(1)'' command included with GCC:
 +
 +''# //linenum// "//filename//" //flags//''
 +
 +Alternatively, ''#line'' could be used instead of a simple ''#''.
 +
 +The //flags// field has the following potential values:
 +
 +1 - Indicates the start of a new file.
 +
 +2 - Indicates the return to a file after having switched to another.
 +
 +This syntax has the advantage of being 100% backward-compatible with earlier versions of PHP, as the ''#'' will be interpreted as starting a one-line comment.
 +
 +Line markers which exist outside of ''<?php ?>'' tags should be considered part of the enclosing HTML/XML and ignored as with all other such content.
  
 ===== Patch ===== ===== Patch =====
  
-No patch has been written yet, pending a determination of feasability/desirability.+No patch has been written yet, pending a determination of feasability and desirability.
  
 ===== Changelog ===== ===== Changelog =====
rfc/linecontrol.1313035965.txt.gz · Last modified: 2017/09/22 13:28 (external edit)