On Mon, 02 Aug 2004 23:58:58 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The guys in the internals list sent me to this forum. > > I am trying to write some serious parsing software in PHP. I need to use plain, > vanilla PHP and no add-on modules, because I need to be able to distribute to people > who don't have sufficient privileges. > > In the process of parsing I create a new document composed of concatenated pieces of > the original document. I am efficiently catting the new document using output > buffer, but when I have to copy non-contiguous pieces form the original document, I > am forced to create substrings, as in: > > echo substr($originalDoc, $startOfSnippet, $snippetLength) > > My documents are potentially large with possibly thousands of such substrings. I > know from writing Java parsers for high-throughput servers that object creation, and > in particular string creation, is the greatest source of degraded performance. > > I'd like to copy the contents of a substring directly to the output buffer without > creating an intermediate object, as in: > > ob_write($string, $start, $length) > > I can find no such function and could envision no other way to do this at present. > > When can I expect broad support for such a function in the base PHP release? Or do > you know of a workaround? > > BTW, because I had to ditch my last email address due to spam, I'm subscribed to > this list through spamex.com. But because the list makes the emails it distributes > appear to original from the people who posted, I have no way to reply through spamex > back to this forum, at least no way to keep the reply in the same thread. > Suggestions, are welcome. Otherwise I'll be starting a new thread. >
If you want this to be an internal function (and you seem to), then you'll either have to write an extension which does this or have the internals guys add it for you. You can't implement something like this in PHP code. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php