|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-10-09 14:23 UTC] f dot bosch at genkgo dot nl
[2015-10-11 13:57 UTC] felipe@php.net
-Summary: PHP7 returns true when false is expected
+Summary: PHP returns true when false is expected
[2015-10-11 15:05 UTC] felipe@php.net
[2015-10-11 15:05 UTC] felipe@php.net
-Status: Open
+Status: Closed
[2015-10-11 15:06 UTC] felipe@php.net
-Summary: PHP returns true when false is expected
+Summary: PHP7 returns true when false is expected
-Assigned To:
+Assigned To: felipe
[2015-10-16 06:52 UTC] f dot bosch at genkgo dot nl
[2015-11-09 18:12 UTC] ab@php.net
[2016-04-18 09:30 UTC] bwoebi@php.net
[2016-07-20 11:36 UTC] davey@php.net
[2016-07-20 11:36 UTC] davey@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
Description: ------------ If you are using php functions inside an XSL script and return 'false', then XSL sees it as 'true', and vice versa. Test script: --------------- PHP script $xslDoc = new DOMDocument(); $xslDoc->load('Stubs/php-functions.xsl'); $xmlDoc = new DOMDocument(); $xmlDoc->load('Stubs/collection.xml'); $native = new \XSLTProcessor(); $native->importStylesheet($xslDoc); $native->registerPHPFunctions(); $nativeResult = trim($native->transformToXML($xmlDoc)); $transpiler = new XsltProcessor(); $transpiler->importStylesheet($xslDoc); $transpiler->registerPHPFunctions(); echo $transpiler->transformToXML($xmlDoc); XML Document <collection /> XSL Sheet <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl"> <xsl:output method="xml" indent="no" omit-xml-declaration="yes" encoding="UTF-8"/> <xsl:template match="collection"> <xsl:value-of select="php:functionString('strpos', 'Hello', 'World')" /> </xsl:template> </xsl:stylesheet> Expected output: false Actual output: true Expected result: ---------------- false Actual result: -------------- true