Bug #66773 [NEW]: Autoload with Opcache allows importing conflicting class name to namespace

From: Date: Tue, 25 Feb 2014 21:29:48 +0000
Subject: Bug #66773 [NEW]: Autoload with Opcache allows importing conflicting class name to namespace
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184432@lists.php.net to get a copy of this message
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)

« previous php.bugs (#184432) next »