I think the issue here is that it doesn't appear to be valid JavaScript at all. 
Or at the very least, it's fairly non-sensical (i.e., execute a print 
statement, which we can only assume is defined for V8Js, store the return value 
[probably undefined?] to a variable, and then "return" that variable).

-Matt

On Mar 14, 2012, at 11:35 PM, Matthew Vickers wrote:

> This seems to be PHP pushing Javascript through V8.
> 
> $JS is a here doc containing some javascript code.
> 
> Matt
> 
> ----- "Dave Clements" wrote:
> > This is a "Javascript" example from the PHP v8 extension
> 
> >
> http://www.php.net/manual/en/v8js.examples.php
> >
> 
> >
> <?php
> > 
> > $v8 = new V8Js();
> > 
> > /* basic.js */
> > $JS = <<< EOT
> > len = print('Hello' + ' ' + 'World!' + "\\n");
> > len;
> > EOT;
> > 
> > try {
> >   var_dump($v8->executeString($JS, 'basic.js'));
> > } catch (V8JsException $e) {
> >   var_dump($e);
> > }
> > 
> > ?>
> >
> 
> >
> 
> >
> I know this isn't Node, but I just wanted to check I'm not mad... the $JS 
> variable.. that's not javascript at all is it? Or have I completely 
> misunderstood v8? 
> -- 
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to