mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 14:01:53 +00:00
pick up int64 export test from issue #287
This commit is contained in:
parent
e86c957811
commit
b45bef46de
32
tests/long_int64.phpt
Normal file
32
tests/long_int64.phpt
Normal file
@ -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===
|
Loading…
Reference in New Issue
Block a user