最近、社内で PHP Spidermonkey が流行って(?)いるようです><! Cybozu Inside Out: SpiderMonkeyを使ってPHPでサーバーサイドJavaScript id:ama-ch さすがです>< というわけで 僕も、 PHP の Spidermonkey でどのくらいのことが出来るのか試してみました>< まず、 Hello, world! <?php // new して $js = new JSContext(); // print 関数作って $js->registerFunction(function($v) { print $v; }, 'print'); // こんにちはこんにちは! $js->evaluateScript('print("Hello, world!!")'); Hello, world!おおお、簡単! 次は、 id:m-hiy
Design walk-through At heart, SpiderMonkey is a fast interpreter that runs an untyped bytecode and operates on values of type JS::Value—type-tagged values that represent the full range of JavaScript values. In addition to the interpreter, SpiderMonkey contains a Just-In-Time (JIT) compiler, a garbage collector, code implementing the basic behavior of JavaScript values, a standard library implement
These are the global objects that are set up automatically by the SpiderMonkey js command-line interpreter when you start the program. Note: this list overlaps with "Built-in functions" in Introduction to the JavaScript shell and is probably not complete. See js/src/shell/js.cpp (around shell_functions) for more. This page lists variables and functions available on SpiderMonkey 53. There may be so
はじめまして。2009年に新卒で入社しました天野祐介です。amachang を期待された方はゴメンナサイ! 先日 SpiderMonkey を利用して PHP から JavaScript を実行する方法を調べる機会がありましたので、ご紹介します。 SpiderMonkey とは SpiderMonkey は C で実装された Mozilla の JavaScript エンジンです。 これを PHP から実行する拡張を利用すると、 PHP コード内で JavaScript が実行できます。 SpiderMonkey extension のインストール こちらhttp://devzone.zend.com/article/4704に記載されている方法で CentOS にインストールしてみました。 PHP 5.3.0 以上が必要です。 $ wget http://ftp.mozilla.org
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く