source: src/router/php7/Zend/tests/int_conversion_exponents.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 5 weeks ago

update php

File size: 1.2 KB
Line 
1--TEST--
2Integer conversion from scientific notation
3--FILE--
4<?php
5
6var_dump((int)"1.2345e9");
7var_dump((int)"-1.2345e9");
8var_dump(intval("1.2345e9"));
9var_dump(intval("-1.2345e9"));
10var_dump("1.2345e9" % PHP_INT_MAX);
11var_dump("-1.2345e9" % PHP_INT_MIN);
12var_dump("1.2345e9" | 0);
13var_dump("-1.2345e9" | 0);
14
15echo PHP_EOL;
16
17var_dump((int)" 1.2345e9  abc");
18var_dump((int)" -1.2345e9  abc");
19var_dump(intval(" 1.2345e9  abc"));
20var_dump(intval(" -1.2345e9  abc"));
21var_dump(" 1.2345e9  abc" % PHP_INT_MAX);
22var_dump(" -1.2345e9  abc" % PHP_INT_MIN);
23var_dump(" 1.2345e9  abc" | 0);
24var_dump(" -1.2345e9  abc" | 0);
25
26?>
27--EXPECTF--
28int(1234500000)
29int(-1234500000)
30int(1234500000)
31int(-1234500000)
32int(1234500000)
33int(-1234500000)
34int(1234500000)
35int(-1234500000)
36
37int(1234500000)
38int(-1234500000)
39int(1234500000)
40int(-1234500000)
41
42Notice: A non well formed numeric value encountered in %s on line %d
43int(1234500000)
44
45Notice: A non well formed numeric value encountered in %s on line %d
46int(-1234500000)
47
48Notice: A non well formed numeric value encountered in %s on line %d
49int(1234500000)
50
51Notice: A non well formed numeric value encountered in %s on line %d
52int(-1234500000)
Note: See TracBrowser for help on using the repository browser.