Bug #54090 [Com]: ReflectionClass::getStartLine reports wrong value for autoloaded classes.
| From: | tomas dot fejfar at gmail dot com | Date: | Wed, 07 Jun 2017 10:22:48 +0000 |
| Subject: | Bug #54090 [Com]: ReflectionClass::getStartLine reports wrong value for autoloaded classes. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209404@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54090&edit=1
ID: 54090
Comment by: tomas dot fejfar at gmail dot com
Reported by: mp at nanasoft dot hu
Summary: ReflectionClass::getStartLine reports wrong value
for autoloaded classes.
Status: Open
Type: Bug
Package: Reflection related
Operating System: GNU/Linux (Fedora 14)
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
In my case the end line is incorrectly reported (+1). Unfortunatelly it's very hard to
replicate. Whenever I try to isolate it, it starts working.
Windows, PHP 7.1.5 (cli) (built: May 9 2017 19:52:16) ( ZTS MSVC14 (Visual C++ 2015) x86 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.5, Copyright (c) 1999-2017, by Zend Technologies
Disabling opcache fixes the issue and endLine is correctly reported. Opcache related settings:
opcache.blacklist_filename => no value => no value
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => On => On
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.fast_shutdown => 0 => 0
opcache.file_cache => no value => no value
opcache.file_cache_consistency_checks => 1 => 1
opcache.file_cache_fallback => 1 => 1
opcache.file_cache_only => 0 => 0
opcache.file_update_protection => 2 => 2
opcache.force_restart_timeout => 180 => 180
opcache.inherited_hack => On => On
opcache.interned_strings_buffer => 8 => 8
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 10000 => 10000
opcache.max_file_size => 0 => 0
opcache.max_wasted_percentage => 5 => 5
opcache.memory_consumption => 128 => 128
opcache.mmap_base => no value => no value
opcache.opt_debug_level => 0 => 0
opcache.optimization_level => 0x7FFFBFFF => 0x7FFFBFFF
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 2 => 2
opcache.revalidate_path => Off => Off
opcache.save_comments => 1 => 1
opcache.use_cwd => On => On
opcache.validate_permission => Off => Off
opcache.validate_timestamps => On => On
Previous Comments:
------------------------------------------------------------------------
[2011-02-24 13:50:48] mp at nanasoft dot hu
Description:
------------
When a require_once call causes other files to be loaded, the ReflectionClass object of any of those
classes loaded from an extra file via the __autoload method returns the classes' start line and
end line incorrectly from the ReflectionClass::getStartLine() and ReflectionClass::getEndLine()
methods. I think the start line and the end line values come from the class that caused the extra
files to load.
Expected result:
----------------
The correct start line and end line values should be returned.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54090&edit=1