forked from phpv8/v8js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pick up int64 export test from issue phpv8#287
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--TEST-- | ||
Test V8::executeString() : Check long 64-bit export from PHP to JS | ||
--SKIPIF-- | ||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
$addInt = function ($a, $b) { | ||
return $a + $b; | ||
}; | ||
|
||
$v8 = new V8Js('PHP'); | ||
$v8->add = $addInt; | ||
$v8->p1 = 10; | ||
$v8->p2 = pow(2,45); | ||
|
||
var_dump($v8->p2); | ||
|
||
var_dump($v8->executeString(' | ||
var res = PHP.p1 + PHP.p2; | ||
"p1:" + PHP.p1 + | ||
", p2:" + PHP.p2 + | ||
", PHP.add(p1,p2)=" + PHP.add(PHP.p1, PHP.p2) + | ||
", p1+p2=" + res + | ||
" -> " + (new Date(res)).toISOString(); | ||
')); | ||
?> | ||
===EOF=== | ||
--EXPECT-- | ||
int(35184372088832) | ||
string(105) "p1:10, p2:35184372088832, PHP.add(p1,p2)=35184372088842, p1+p2=35184372088842 -> 3084-12-12T12:41:28.842Z" | ||
===EOF=== |