php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63791 ReflectionClass::getFileName returns an empty string when wincache is loaded
Submitted: 2012-12-17 21:54 UTC Modified: 2013-01-23 21:51 UTC
From: marcel dot ouellette at wgtech dot com Assigned:
Status: Closed Package: WinCache (PECL)
PHP Version: 5.4.9 OS: Windows 7
Private report: No CVE-ID: None
 [2012-12-17 21:54 UTC] marcel dot ouellette at wgtech dot com
Description:
------------
The "getFileName" method of ReflectionClass returns an empty string when it should return a valid path.  The correct value is returned the first time it is run, however, every call afterward returns an empty string.


PHP 5.4.9 NTS
Apache 2.2.22 fcgid 2.3.7

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
json
ldap
libxml
mbstring
mcrypt
memcache
mhash
mysqlnd
oci8
odbc
openssl
pcre
PDO
pdo_mysql
PDO_OCI
PDO_ODBC
pdo_pgsql
pdo_sqlite
Phar
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlsrv
standard
tidy
tokenizer
wddx
wincache
xdebug
xhprof
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]
Xdebug

Test script:
---------------
<?php 
//Run this twice with wincache loaded
//Run twice without wincache loaded
class Foo{
	
	public function dump(){
		$r    = new ReflectionClass($this);
		$path = $r->getFileName();
		
		var_dump($path);
	}
	
}

$test = new Foo();
$test->dump();

Expected result:
----------------
A var_dump of a string containing the path to the current file.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-23 21:51 UTC] marcel dot ouellette at wgtech dot com
-Status: Open +Status: Closed
 [2013-01-23 21:51 UTC] marcel dot ouellette at wgtech dot com
fixed w/version 1.3.4.0
 [2014-12-06 04:06 UTC] jochemstoel at gmail dot com
This is not a bug. ReflectionMethod getFileName() only does user classes. (not PHP internal or PEAR)
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Sep 20 08:01:26 2018 UTC