Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb29979

Browse filesBrowse files
committed
avoid (string) catchable fatal error for __PHP_Incomplete_Class instances
1 parent 2573a38 commit bb29979
Copy full SHA for bb29979

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed

‎src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ protected function varToString($var)
4545
return sprintf('Object(%s)', get_class($var));
4646
}
4747

48+
if ($var instanceof \__PHP_Incomplete_Class) {
49+
return sprintf('__PHP_Incomplete_Class(%s)', $this->getClassNameFromIncomplete($var));
50+
}
51+
4852
if (is_array($var)) {
4953
$a = array();
5054
foreach ($var as $k => $v) {
@@ -72,4 +76,11 @@ protected function varToString($var)
7276

7377
return (string) $var;
7478
}
79+
80+
private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $var)
81+
{
82+
$array = new \ArrayObject($var);
83+
84+
return $array['__PHP_Incomplete_Class_Name'];
85+
}
7586
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.