-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't disable early binding during preloading script
We should only disable early binding during the opcache_compile_file() calls, not inside the preloading script or anything it includes. The right condition to check for is whether we compile the file without execution, as declaring classes is "execution".
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
var_dump(new X); | ||
class X {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Early binding should work fine inside the preload script | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.optimization_level=-1 | ||
opcache.preload={PWD}/preload_early_binding.inc | ||
--SKIPIF-- | ||
<?php | ||
require_once('skipif.inc'); | ||
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows'); | ||
?> | ||
--FILE-- | ||
OK | ||
--EXPECT-- | ||
object(X)#1 (0) { | ||
} | ||
OK |