UNPKG

phpjs

Version:

php.js offers community built php functions in javascript

24 lines (17 loc) 961 B
<!-- Generated by Rakefile:build --> <strong> <a href="http://brett-zamir.me" rel="nofollow">Brett Zamir</a> </strong> on 2012-06-21 02:36:37 <br /> @David: Thanks for the fix with the missing userdata argument. I changed it a bit to check for arguments.length (number of arguments passed), since otherwise, it won't allow explicit passing of &quot;undefined&quot; as an argument. I also added support for closures and PHP-style object-function arrays, added an option to avoid eval (not on by default since eval() is more PHP-like in allowing calls to built-in functions), and provided support within array() for walk() as a chainable method. Changes are in Git (see &quot;raw js source&quot;). <hr /> <strong> David </strong> on 2012-06-18 20:34:46 <br /> Line 21 doesn't make any sense, you are only passing userdata to the function, and userdata is undefined. Line 21 should be: <pre><code> eval(funcname + '(array[key] , key)'); </code></pre> <hr />