php-js

php-js is an experimental PHP extension which embeds the Mozilla SpiderMonkey JavaScript engine into PHP.
Download

php-js Ranking & Summary

Advertisement

  • Rating:
  • License:
  • The PHP License
  • Price:
  • FREE
  • Publisher Name:
  • Omar Kilani
  • Publisher web site:
  • http://aurore.net/projects/php-js/

php-js Tags


php-js Description

php-js is an experimental PHP extension which embeds the Mozilla SpiderMonkey JavaScript engine into PHP. php-js application is an experimental PHP extension which embeds the Mozilla SpiderMonkey JavaScript engine into PHP.Installation and Usage:A simple ./configure; make; make install should do the trick. Make sure to add an extension=js.so line to your php.ini/php.d. Note: you need to install libjs first. If you're using a Redhat-esque system, you can use the SRPM provided above, else, use the TBZ.Then, just use js_eval to evaluate your JavaScript. js_eval returns the value returned by the JavaScript interpreter to PHP.For example:js_eval("var a = 123;");js_eval("var b = 456;");$c = js_eval(";");echo "a is ".$c."n";echo "b is ".$c."n";js_eval("var sum = function(x, y) { return x + y; }");$d = js_eval("sum(a, b);");echo "The sum of a and b is ".$d."n"; Would produce:a is 123b is 456The sum of a and b is 579 js_eval takes an optional boolean argument, assoc, which returns objects as associative arrays instead of PHP objects.The php-js execution environment provides two built-in JavaScript system functions:printgcprint outputs its argument to the php output stream.gc forces garbage collection within the JavaScript environment.What's New in This Release:· A session shutdown issue has been fixed.· There is better handling of null objects.


php-js Related Software