Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d48fae7

Browse files
bug #22307 [Debug] Fix php notice (enumag)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #22307). Discussion ---------- [Debug] Fix php notice | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Of course autoloading of an empty string should not actually happen (fixed that in twigphp/Twig#2438) but if it does happen it should not throw a php notice. ``` Notice: Uninitialized string offset 0 ``` Commits ------- e333a1a [Debug] Fix php notice
2 parents 2adfb37 + e333a1a commit d48fae7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function loadClass($class)
186186

187187
$exists = class_exists($class, false) || interface_exists($class, false) || (function_exists('trait_exists') && trait_exists($class, false));
188188

189-
if ('\\' === $class[0]) {
189+
if ($class && '\\' === $class[0]) {
190190
$class = substr($class, 1);
191191
}
192192

0 commit comments

Comments
 (0)