Bug #77649 [Opn]: preload: Can't preload class %s with unresolved initializer for constant
| From: | nikic@php.net | Date: | Fri, 22 Feb 2019 08:25:16 +0000 |
| Subject: | Bug #77649 [Opn]: preload: Can't preload class %s with unresolved initializer for constant | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219694@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77649&edit=1
ID: 77649
Updated by: nikic@php.net
Reported by: mberchtold at gmail dot com
Summary: preload: Can't preload class %s with unresolved
initializer for constant
Status: Open
Type: Bug
Package: opcache
Operating System: Windows 10 x64
PHP Version: master-Git-2019-02-21 (snap)
Block user comment: N
Private report: N
New Comment:
I'm not able to reproduce this.
Previous Comments:
------------------------------------------------------------------------
[2019-02-21 22:33:21] mberchtold at gmail dot com
Description:
------------
This is related to the bug that was reported (and fixed) here:
https://bugs.php.net/bug.php?id=77643
Basically I'm trying to preload some parts of zend framework 3 and the following warning is
logged:
PHP Warning: Can't preload class Zend\Db\Sql\Select with unresolved initializer for constant
JOIN_LEFT_OUTER at vendor\zendframework\zend-db\src\Sql\Select.php:21 in Unknown on line 0
The constant is defined as following in Select.php
const JOIN_LEFT_OUTER = Join::JOIN_LEFT_OUTER;
where JOIN_LEFT_OUTER is defined in Join.php:
const JOIN_LEFT_OUTER = 'left outer';
Test script:
---------------
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.preload={PWD}/preload_undef_const_5.inc
preload_undef_const_5.inc:
<?php
$basedirectory = 'C:/test/';
// dependent classes
opcache_compile_file($basedirectory . 'vendor/zendframework/zend-db/src/Sql/Join.php');
opcache_compile_file($basedirectory .
'vendor/zendframework/zend-db/src/Sql/AbstractPreparableSql.php');
opcache_compile_file($basedirectory .
'vendor/zendframework/zend-db/src/Sql/AbstractSql.php');
opcache_compile_file($basedirectory .
'vendor/zendframework/zend-db/src/Sql/SqlInterface.php');
opcache_compile_file($basedirectory .
'vendor/zendframework/zend-db/src/Sql/PreparableSqlInterface.php');
opcache_compile_file($basedirectory .
'vendor/zendframework/zend-db/src/Sql/Platform/PlatformDecoratorInterface.php');
// actual class
opcache_compile_file($basedirectory . 'vendor/zendframework/zend-db/src/Sql/Select.php');
Expected result:
----------------
no warning
Actual result:
--------------
PHP Warning: Can't preload class Zend\Db\Sql\Select with unresolved initializer for constant
JOIN_LEFT_OUTER at vendor\zendframework\zend-db\src\Sql\Select.php:21 in Unknown on line 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77649&edit=1