<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>v8js.so | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/v8js-so/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Thu, 08 Mar 2012 23:25:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>run JavaScript code in PHP 5.3 with the v8js extension</title>
		<link>https://nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Thu, 08 Mar 2012 23:14:10 +0000</pubDate>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[v8js.so]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2102</guid>

					<description><![CDATA[<p>&#8230;for some reason i needed to get t h i s to work before going to sleep. I&#8217;m running OSX 10.7.3 with macports which usually does the job, but  Google&#8217;s V8 Javascript Engine is not available as a port yet. So&#8230; homebrew to the rescue: installed it: and installed v8 wait, this seems too easy. &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/" class="more-link">Continue reading<span class="screen-reader-text"> "run JavaScript code in PHP 5.3 with the v8js extension"</span></a></p>
The post <a href="https://nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/">run JavaScript code in PHP 5.3 with the v8js extension</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>&#8230;for some reason i needed to get <strong><a href="http://php.net/manual/en/book.v8js.php">t h i s</a></strong> to work before going to sleep.</p>
<p>I&#8217;m running OSX 10.7.3 with <a href="http://www.macports.org/">macports</a> which usually does the job, but  <a href="http://code.google.com/p/v8/">Google&#8217;s V8 Javascript Engine</a> is not available as a port yet.<span id="more-2102"></span></p>
<p>So&#8230; <a href="http://mxcl.github.com/homebrew/">homebrew</a> to the rescue:</p>
<p>installed it:</p>
<pre class="brush: bash; title: ; notranslate">
/usr/bin/ruby -e &quot;$(/usr/bin/curl -fsSL https://raw.github.com/gist/323731)&quot;
</pre>
<p>and installed v8</p>
<pre class="brush: bash; title: ; notranslate">
brew install v8
</pre>
<p>wait, this seems <a href="http://www.youtube.com/watch?v=jWI8w9kLAks">too easy</a>.</p>
<p>PECL installed some beta version of the PHP extension.</p>
<pre class="brush: bash; title: ; notranslate">
sudo pecl install channel://pecl.php.net/v8js-0.1.2
</pre>
<p>added</p>
<pre class="brush: bash; title: ; notranslate">extension=v8js.so</pre>
<p>to the php.ini file.</p>
<p>und bitteschön:</p>
<pre class="brush: php; title: ; notranslate">

$v8 = new V8Js();
var_dump($v8-&gt;executeString(&quot;

//hey i'm Javascript Code

//INSIDE PHP !

//wow.
var hello = 'Hallo';

function helloWorld( string ){
return hello + ' ' + string;
}

helloWorld('World');

&quot;));

</pre>
<p>Such things might come in handy one day, <a href="https://plus.google.com/115423703838305233565/posts/VtskgWhB3kV">you know</a>.</p>The post <a href="https://nerdpress.org/2012/03/09/run-javascript-code-in-php-5-3-with-the-v8js-extension/">run JavaScript code in PHP 5.3 with the v8js extension</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
