RE: FW: [PHP-DEV] Long awaited line directive
| From: | Zeev Suraski | Date: | Fri, 11 Aug 2006 09:30:29 +0000 |
| Subject: | RE: FW: [PHP-DEV] Long awaited line directive | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25310@lists.php.net to get a copy of this message | ||
I think we can divide the discussion to (a) whether or not we need this feature, and (b) everything else.
Regarding (b), I agree completely with everything Stas said (no #xyz syntax, no code generation in the scanner, etc.).
Regarding (a), we're likely to get the standard discussion of simplicity/clarity vs. power. I think that in this particular case, we can possibly come up with a solution that satisfies both camps completely.
The solution I propose is to create internal functions that will set 'virtual' filenames and line ranges, that will be saved in some sort of a translation table, of real filename + line range to virtual filename + lineno. The error callback can be made smarter to search in the translation table, and in case of a match, report the virtual filename:linenumber in addition to the real ones.
With that solution, there's no need to change any of the internal structures and there are no compatibility concerns.
Thoughts?
Zeev
At 08:32 11/08/2006, Andi Gutmans wrote:
Some feedback from Stas on the subject. I agree with him completely but wanted to get a second opinion. Honestly I think while this is somewhat useful for auto-generated files, it's not worth the risk and effort. It's a very marginal feature and very few people will use it. Supporting it in a non-intrusive way, at high quality and without making it significantly harder for debuggers and profilers to work with this is just not worth it... Andi -----Original Message----- From: Stanislav Malyshev [mailto:stas@zend.com] Sent: Tuesday, August 08, 2006 7:22 AM To: Andi Gutmans Subject: Re: FW: [PHP-DEV] Long awaited line directiveI'm afraid this one would confuse debuggers. Also, if there's any error in PHP code following line directive, it will be reported with new filename, even if there's actually no code causing this problem in this filename. Also, I don't like too much the #-syntax too. And I'm not sure it's healthy to generate code in scanner - AFAIK there was no code generated in the scanner previously. What would happen if someone runs tokenizer (which uses lex_scan) on such script? Or even highlighter? -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php