Bug #54090 [Fbk->NoF]: ReflectionClass::getStartLine reports wrong value for autoloaded classes.

From: Date: Sun, 08 Mar 2020 04:22:04 +0000
Subject: Bug #54090 [Fbk->NoF]: ReflectionClass::getStartLine reports wrong value for autoloaded classes.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225943@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 Updated by: php-bugs@lists.php.net Reported by: mp at nanasoft dot hu Summary: ReflectionClass::getStartLine reports wrong value for autoloaded classes. -Status: Feedback +Status: No Feedback Type: Bug Package: Reflection related Operating System: GNU/Linux (Fedora 14) PHP Version: 5.3.5 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-02-28 14:45:15] nikic@php.net Given the age of the bug, I'm pretty sure this issues doesn't exist anymore, please tell me if that's not the case. ------------------------------------------------------------------------ [2017-06-07 10:22:34] tomas dot fejfar at gmail dot com 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#225943) next »