diff --git a/targets/php/php.inc.php b/targets/php/php.inc.php index b74bde6..96fee31 100644 --- a/targets/php/php.inc.php +++ b/targets/php/php.inc.php @@ -340,10 +340,10 @@ class mtgPHPCodegen extends mtgCodegen if(!is_array($args)) throw new Exception("Bad filter args: $args_json"); } - if ($add_assoc_check) - return "\$assoc ? $filter_func($val, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ") : $val"; + if($add_assoc_check) + $str = "(\$assoc ? $filter_func($str, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ") : $str)"; else - return "$filter_func($val, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ")"; + $str = "$filter_func($str, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ")"; } else throw new Exception("No such filter '$filter_func'");