php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45196 Source filters
Submitted: 2008-06-06 21:53 UTC Modified: 2020-10-17 13:37 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: timtowdi at yahoo dot com Assigned:
Status: Suspended Package: Scripting Engine problem
PHP Version: 5.2.6 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
33 - 2 = ?
Subscribe to this entry?

 
 [2008-06-06 21:53 UTC] timtowdi at yahoo dot com
Description:
------------
It would be immensely useful to have a source filtering capability similar to Perl:

http://perldoc.perl.org/perlfilter.html

Essentially, a way to allow a special block of code to execute and "filter" through the source code of the script before it is fed through the interpreter.

This would allow some very useful features, such as embedding debugging code within comments, and then automatically executing that code if a debugging filter is included into the script.  Thus, if the filter is left out, the debugging code remains harmless comments:

<?php
include('debug.php');
$result = some_convoluted_function();
### Expected: 106852.244
### Got: $result
?>

This particular kind of example is based off the Perl Smart::Comments module:

http://search.cpan.org/search?query=Smart%3A%3AComments&mode=module


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:20 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2020-10-17 13:37 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2020-10-17 13:37 UTC] cmb@php.net
This feature would require discussion on the internals mailing
list[1], and likely the RFC process[2].  If you, or anybody else,
is still interested in this feature, please forward the request to
the internals mailing list.  For the time being, I'm suspending
this ticket.

[1] <https://www.php.net/mailing-lists.php#internals>
[2] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC