Nowdocs revised

php.internals

Gwynne Raskind

19 years ago
I've taken my original nowdocs patch and revamped it to be much more efficient and functional. This version: - Parses nowdocs as constant strings rather than ADD_STRING opcodes. - Allows the flex scanner do less work. - Enables nowdocs to be used in static_scalar contexts, such as class constants and static variable initializers. - Includes more tests than before. - Is fully compatible with the most recent CVS checkouts for HEAD and PHP_5_2, and also merges cleanly into a 5.2.3 source tree. - Breaks zero regression tests out of all 3000 or so. The patch also cleans up the zend_language_scanner.l code a little bit, cosmetically speaking, and the PHP_5_2 patch updates the scanner by factoring out single-quoted string scanning, as HEAD already did. The patch is available for download at <http:// phpdoc.gwynne.dyndns.org/nowdocs.zip>, and browsable at <http:// phpdoc.gwynne.dyndns.org/nowdocs/>. -- Gwynne, Daughter of the Code "This whole world is an asylum for the incurable."