#38218 [NEW]: php:functionString tries to access objects with their names in lowercase

From: Date: Wed, 26 Jul 2006 08:47:20 +0000
Subject: #38218 [NEW]: php:functionString tries to access objects with their names in lowercase
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99904@lists.php.net to get a copy of this message
From:             moksinski at gmail dot com
Operating system: windows 2000
PHP version:      6CVS-2006-07-26 (snap)
PHP Bug Type:     XSLT related
Bug description:  php:functionString tries to access objects with their names in lowercase

Description:
------------
php:functionString tries to access objects with their names in lowercase.
when you use autoloader to include your classes it generates fatal error
because it cannot find the proper php file.

Reproduce code:
---------------
<?php //FILE AutoLoaded.php 
class AutoLoaded { public static function printText($text) { return $text;
}} 
?>

<?php //FILE index.php
$xsl=<<<EOSTRING
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl"
xsl:extension-element-prefixes="php">
<xsl:template match="xml"><xsl:value-of
select="php:functionString('AutoLoaded::printText',@dummy)"
disable-output-escaping="yes"/>
</xsl:template></xsl:stylesheet>
EOSTRING;
$xml='<xml dummy="everything is ok"/>';
function __autoload($className) {
    echo $className."\n";
    static $classes = array('AutoLoaded'=>'AutoLoaded.php');
    require_once($classes[$className]);
}
$doc = new DOMDocument('1.0','utf-8'); $doc->loadxml($xml); $xslt = new
DOMDocument(); $xslt->loadxml($xsl);
$proc = new XSLTProcessor(); $proc->registerPHPFunctions();
$proc->importStyleSheet($xslt);
$proc->transformToXML($doc);
?>

Expected result:
----------------
AutoLoaded

Actual result:
--------------
autoloaded
Fatal error: require_once() [function.require]: Failed opening required
....

-- 
Edit bug report at http://bugs.php.net/?id=38218&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38218&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38218&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38218&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38218&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=38218&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38218&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38218&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38218&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38218&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38218&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=38218&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=38218&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38218&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38218&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38218&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38218&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38218&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38218&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38218&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38218&r=mysqlcfg


Thread (6 messages)

« previous php.bugs (#99904) next »