

SpiderMonkey + PHP: Embed Mozilla's Javascript engine Spidermonkey in PHP - barredo
http://pecl.php.net/package/spidermonkey

======
KevBurnsJr

      <?php
      $js = new JSContext();
      
      $obj = new stdClass;
      $obj->age = 19;
      $obj->name = 'Roger';
      
      $js->assign('me', $obj);
      
      $script = <<<END
        function whoami() {
          str = 'My name is ' + me.name +
                ' and I am ' + me.age + ' years old.';
          return str;
        }
        whoami();
      END;
      
      echo $js->evaluateScript($script);
      ?>
    

So far, I like. Wonder if it's horrendously slow.

<http://devzone.zend.com/article/4704>

------
KevBurnsJr
Note: Requires PHP 5.3.x

