php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54090 ReflectionClass::getStartLine reports wrong value for autoloaded classes.
Submitted: 2011-02-24 13:50 UTC Modified: 2020-03-08 04:22 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mp at nanasoft dot hu Assigned:
Status: No Feedback Package: Reflection related
PHP Version: 5.3.5 OS: GNU/Linux (Fedora 14)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mp at nanasoft dot hu
New email:
PHP Version: OS:

 

 [2011-02-24 13:50 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-07 10:22 UTC] 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
 [2020-02-28 14:45 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2020-02-28 14:45 UTC] 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.
 [2020-03-08 04:22 UTC] php-bugs at lists dot php dot net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 21:01:29 2024 UTC