-
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.
Temporary reset filename and lineno override before autoload
- Loading branch information
Showing
6 changed files
with
59 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,33 @@ | ||
--TEST-- | ||
GH-10232 (Weird behaviour when a file is autoloaded in assignment of a constant) | ||
--FILE-- | ||
<?php | ||
|
||
set_include_path('gh10232-nonexistent') or exit(1); | ||
chdir(__DIR__) or exit(1); | ||
|
||
spl_autoload_register(function () { | ||
trigger_error(__LINE__); | ||
$ex = new Exception(); | ||
echo 'Exception on line ', $ex->getLine(), "\n"; | ||
require_once __DIR__ . '/gh10232/constant_def.inc'; | ||
}, true); | ||
|
||
|
||
class ConstantRef | ||
{ | ||
public const VALUE = ConstantDef::VALUE; | ||
} | ||
|
||
ConstantRef::VALUE; | ||
|
||
?> | ||
--EXPECTF-- | ||
Notice: 7 in %sgh10232.php on line 7 | ||
Exception on line 8 | ||
|
||
Notice: constant_def.inc in %sconstant_def.inc on line 3 | ||
Exception in constant_def.inc on line 4 | ||
|
||
Notice: required.inc in %srequired.inc on line 3 | ||
Exception in required.inc on line 4 |
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,12 @@ | ||
<?php | ||
|
||
trigger_error(basename(__FILE__)); | ||
$ex = new Exception(); | ||
echo 'Exception in ', basename($ex->getFile()), ' on line ', $ex->getLine(), "\n"; | ||
|
||
require_once 'required.inc'; // The script of the same directory. | ||
|
||
class ConstantDef | ||
{ | ||
const VALUE = true; | ||
} |
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,5 @@ | ||
<?php | ||
|
||
trigger_error(basename(__FILE__)); | ||
$ex = new Exception(); | ||
echo 'Exception in ', basename($ex->getFile()), ' on line ', $ex->getLine(), "\n"; |
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