Skip to content

Commit

Permalink
Fixed erroneous fn* -> native PHP function conversion.
Browse files Browse the repository at this point in the history
Added test for callbacks during interop which is where this failure showed up.
  • Loading branch information
chr15m committed Feb 11, 2017
1 parent 65af053 commit 7954b71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions php/interop.php
Expand Up @@ -19,8 +19,6 @@ function _to_php($obj) {
return ${$obj->value};
} elseif (_atom_Q($obj)) {
return $obj->value;
} elseif (_function_Q($obj)) {
return $obj->func;
} else {
return $obj;
}
Expand Down
5 changes: 5 additions & 0 deletions php/tests/stepA_mal.mal
Expand Up @@ -29,6 +29,11 @@
(! date "Y-m-d" 0)
;=>"1970-01-01"

;; testing native function with mal callback

(! array_map (fn* [t] (if (> t 3) t)) [1 2 3 4 5 6])
;=>(nil nil nil 4 5 6)

;; testing superglobal variable access

(get ($ "_SERVER") "PHP_SELF")
Expand Down

0 comments on commit 7954b71

Please sign in to comment.