php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73353 Discrepancy with opcache enabled/disabled
Submitted: 2016-10-19 19:19 UTC Modified: 2016-11-05 01:09 UTC
From: love at sickpeople dot se Assigned:
Status: Closed Package: opcache
PHP Version: 7.1.0RC4 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: love at sickpeople dot se
New email:
PHP Version: OS:

 

 [2016-10-19 19:19 UTC] love at sickpeople dot se
Description:
------------
With opcache enabled PHP fails with "Cannot declare class Foo, because the name is already in use".

If opcache is disabled, the code is working as expected (no error).

I have no .ini files except one file with "opcache.enable = 1", in conf.d

Test script:
---------------
/* File 1 */


  ini_set ('display_errors', true);

  var_dump (opcache_is_script_cached (__FILE__));

  include "foo.php";
  include "foo.php";



/* File "foo.php" */

if (class_exists ('Foo', false))
  {
    return;
  }

class Foo {}


Expected result:
----------------
The second include of foo.php should return before declaring Foo again.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-05 01:09 UTC] love at sickpeople dot se
-Status: Open +Status: Closed
 [2016-11-05 01:09 UTC] love at sickpeople dot se
This is not a new problem. It is fixed by setting the INI opcache.dups_fix.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 11 13:01:27 2024 UTC