|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2008-05-02 14:46 UTC] aldo at armiento dot com
  [2008-05-02 16:06 UTC] felipe@php.net
  [2008-05-04 15:15 UTC] rrichards@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
Description: ------------ Using registerPHPFunctions and calling a PHP function from XSL with first parameter an XSL Variable (instead of node, node-text, etc.) produces a memory leak. Also "memory_limit" directive in php.ini is ignored. Reproduce code: --------------- <?php // XML Contents $sXML = <<< EOD <?xml version="1.0" encoding="UTF-8"?> <root>root node</root> EOD; $domXML = new DOMDocument(); $domXML->loadXML($sXML); // XSL Contents $sXSL = <<< EOD <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl"> <xsl:template match="/"> <xsl:variable name="variable"> text </xsl:variable> <xsl:value-of select="php:functionString('trim', \$variable)" /> </xsl:template> </xsl:stylesheet> EOD; $domXSL = new DOMDocument(); $domXSL->loadXML($sXSL); // XSLT Processor $xsltProcessor = new XSLTProcessor(); $xsltProcessor->registerPHPFunctions(); $xsltProcessor->importStyleSheet($domXSL); while (true) { $xsltProcessor->transformToDoc($domXML); } Expected result: ---------------- Nothing. Actual result: -------------- All server available memory is used.