diff --git a/SConstruct b/SConstruct
index dac010753d5fd91088fe94d1536eef3d21ffc34a..a9f9c670cab5505c3d3043e0e7937c94c88f065c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -69,7 +69,7 @@ dbg = env.Clone(VARIANT='debug')
 dbg.Append(CCFLAGS=['-g'])
 
 opt = env.Clone(VARIANT='opt')
-opt.Append(CCFLAGS="-O3")
+opt.Append(CCFLAGS=["-O3"])
 
 if GetOption("variant") == 'debug':
     env = dbg
diff --git a/src/bindings/php/hammer.i b/src/bindings/php/hammer.i
index 63038ccf89b44766c40ce3406a8ef3f5249495ea..92857db96bc3add9fd0c18235c7af3a991141aca 100644
--- a/src/bindings/php/hammer.i
+++ b/src/bindings/php/hammer.i
@@ -1,5 +1,8 @@
 %module hammer;
 %include "exception.i";
+%{
+#include "allocator.h"
+  %}
 
 %ignore HCountedArray_;
 
@@ -8,6 +11,7 @@
   %}
 
 %init %{
+  TSRMLS_FETCH(); 
   h_tt_php = h_allocate_token_type("com.upstandinghackers.hammer.php");
   %}
 
@@ -161,9 +165,11 @@
   }
 
   static HParsedToken* call_action(const HParseResult *p, void *user_data) {
-    zval *args[1];
+    zval **args;
     zval func;
     zval *ret;
+    args = (zval**)h_arena_malloc(p->arena, sizeof(*args) * 1); // one-element array of pointers
+    MAKE_STD_ZVAL(args[0]);
     ALLOC_INIT_ZVAL(ret);
     ZVAL_STRING(&func, (const char*)user_data, 0);
     hpt_to_php(p->ast, args[0]);
@@ -179,9 +185,11 @@
   }
 
   static int call_predicate(HParseResult *p, void *user_data) {
-    zval *args[1];
+    zval **args;
     zval func;
     zval *ret;
+    args = (zval**)h_arena_malloc(p->arena, sizeof(*args) * 1); // one-element array of pointers
+    MAKE_STD_ZVAL(args[0]);
     ALLOC_INIT_ZVAL(ret);
     ZVAL_STRING(&func, (const char*)user_data, 0);
     hpt_to_php(p->ast, args[0]);