-
Notifications
You must be signed in to change notification settings - Fork 202
/
Copy pathlong.phpt
44 lines (39 loc) · 876 Bytes
/
long.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--TEST--
Test V8::executeString() : Check long integer handling from PHP to JS
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$v8 = new V8Js();
$v8->long = pow(2, 31);
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
$v8->long = pow(2, 31) + 1;
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
$v8->long = -pow(2, 31);
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
$v8->long = -pow(2, 31) - 1;
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
?>
===EOF===
--EXPECT--
2147483648
2147483649
-2147483648
-2147483649
===EOF===