From b197613274a1e0abdad6d2a33068db9505b57bc2 Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sun, 7 Oct 2018 15:37:00 +0100 Subject: [PATCH 1/2] Fix error logging with default engine configuration By default, configuration values for `log_errors` and `display_errors` depend on how PHP has been configured, and need to be made consistent in order for functionality to conform to expectations. Additionally, the list of errors handled has been expanded to `E_ALL` instead of whatever the default value is. --- engine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine.c b/engine.c index 4c87203..4539715 100644 --- a/engine.c +++ b/engine.c @@ -19,6 +19,9 @@ const char engine_ini_defaults[] = { "expose_php = 0\n" "default_mimetype =\n" "html_errors = 0\n" + "log_errors = 1\n" + "display_errors = 0\n" + "error_reporting = E_ALL\n" "register_argc_argv = 1\n" "implicit_flush = 1\n" "output_buffering = 0\n" From f59ad77455d92d536ce80f5a6c85dc3f3562bd35 Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sun, 7 Oct 2018 16:20:53 +0100 Subject: [PATCH 2/2] Fix issues with comparing serialized floating-point numbers This commit fixes long-standing issues with comparing floating-point numbers bound into PHP with their original numbers in Go, where issues with imprecise storage may cause errors to occur. --- context_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/context_test.go b/context_test.go index a2948da..1205f49 100644 --- a/context_test.go +++ b/context_test.go @@ -261,6 +261,8 @@ func TestContextBind(t *testing.T) { c, _ := e.NewContext() c.Output = &w + c.Eval("ini_set('serialize_precision', 6);") + for i, tt := range bindTests { if err := c.Bind(fmt.Sprintf("t%d", i), tt.value); err != nil { t.Errorf("Context.Bind('%v'): %s", tt.value, err)