Skip to content

Instantly share code, notes, and snippets.

@kevinxucs
Created November 19, 2014 16:58
Show Gist options
  • Save kevinxucs/b13d118fee1d98919a9d to your computer and use it in GitHub Desktop.
Save kevinxucs/b13d118fee1d98919a9d to your computer and use it in GitHub Desktop.
Attempted fix for display_error
--- a/hphp/runtime/ext/std/ext_std_misc.cpp
+++ b/hphp/runtime/ext/std/ext_std_misc.cpp
@@ -46,7 +46,7 @@ IMPLEMENT_THREAD_LOCAL(std::string, s_misc_highlight_default_default);
IMPLEMENT_THREAD_LOCAL(std::string, s_misc_highlight_default_html);
IMPLEMENT_THREAD_LOCAL(std::string, s_misc_display_errors);
-const std::string s_1("1"), s_2("2"), s_stdout("stdout"), s_stderr("stderr");
+const std::string s_0("0"), s_1("1"), s_2("2"), s_stdout("stdout"), s_stderr("stderr");
const double k_INF = std::numeric_limits<double>::infinity();
const double k_NAN = std::numeric_limits<double>::quiet_NaN();
@@ -111,6 +111,9 @@ void StandardExtension::threadInitMisc() {
"display_errors", RuntimeOption::EnableHipHopSyntax ? "stderr" : "1",
IniSetting::SetAndGet<std::string>(
[](const std::string& value) {
+ if (value == s_0) {
+ return true;
+ }
if (value == s_1 || value == s_stdout) {
Logger::SetStandardOut(stdout);
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment