Bug #66773 [NEW]: Autoload with Opcache allows importing conflicting class name to namespace
From: carl dot vuorinen at w3 dot fi
Operating system: Linux (Ubuntu)
PHP version: 5.5.9
Package: opcache
Bug Type: Bug
Bug description:Autoload with Opcache allows importing conflicting class name to namespace
Description:
------------
Autoloading with Opcache enabled allows importing a class from another
namespace with a name that is already in use in the current namespace
and the code to execute successfully. Without Opcache the same code
gives Fatal error.
Test script:
---------------
Here is a small sample script with a few files that will be autoloaded
by the execute.php script. Some test results can be found in the
comments.
https://gist.github.com/cvuorinen/e7a19101d40c9fa0a959
Expected result:
----------------
Fatal error: Cannot use Other\Bar as Bar because the name is already in
use in /tmp/path/some_foo.php on line 5
Actual result:
--------------
self: Some\Bar
parent: Other\Bar
--
Edit bug report at https://bugs.php.net/bug.php?id=66773&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66773&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66773&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66773&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66773&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66773&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66773&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66773&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66773&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66773&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66773&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66773&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66773&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66773&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66773&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66773&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66773&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66773&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66773&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66773&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66773&r=mysqlcfg
Thread (22 messages)
- carl dot vuorinen at w3 dot fi
- carl dot vuorinen at w3 dot fiBug #66773 [Opn]: Autoload with Opcache allows importing conflicting class name to namespace
- adrien dot crivelli at gmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- jpauli@php.netBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- devosc at gmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- dmitry@php.netBug #66773 [Opn->Asn]: Autoload with Opcache allows importing conflicting class name to namespace
- jpauli@php.netBug #66773 [Asn]: Autoload with Opcache allows importing conflicting class name to namespace
- dmitry@php.netBug #66773 [Asn]: Autoload with Opcache allows importing conflicting class name to namespace
- nikic@php.netBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- dmitry@php.netBug #66773 [Asn]: Autoload with Opcache allows importing conflicting class name to namespace
- nikic@php.netBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- john at zerocrates dot orgBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- Erutan409 at Hotmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- kernins at gmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- pawel dot zegardlo at bm dot plBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- incubeftw at gmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- dmitry@php.netBug #66773 [Asn]: Autoload with Opcache allows importing conflicting class name to namespace
- klein dot shaked+php at gmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- klein dot shaked+php at gmail dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- nikic@php.netBug #66773 [Asn->Csd]: Autoload with Opcache allows importing conflicting class name to namespace
- bkfake-php at yahoo dot comBug #66773 [Com]: Autoload with Opcache allows importing conflicting class name to namespace
- nikic@php.netBug #66773 [Csd]: Autoload with Opcache allows importing conflicting class name to namespace