File: preinc_variationStr.phpt

package info (click to toggle)
php8.4 8.4.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 211,276 kB
  • sloc: ansic: 1,176,142; php: 35,419; sh: 11,964; cpp: 7,208; pascal: 4,951; javascript: 3,091; asm: 2,817; yacc: 2,411; makefile: 696; xml: 446; python: 301; awk: 148
file content (75 lines) | stat: -rw-r--r-- 1,696 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--TEST--
Test ++N operator : various numbers as strings
--FILE--
<?php

$strVals = array(
    "0","65","-44", "1.2", "-7.7",
    "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", "a5.9",
    "z", "az", "zz", "Z", "AZ", "ZZ", "9z", "19z", "99z",
);


foreach ($strVals as $strVal) {
    echo "--- testing: '$strVal' ---\n";
    var_dump(++$strVal);
}

?>
--EXPECTF--
--- testing: '0' ---
int(1)
--- testing: '65' ---
int(66)
--- testing: '-44' ---
int(-43)
--- testing: '1.2' ---
float(2.2)
--- testing: '-7.7' ---
float(-6.7)
--- testing: 'abc' ---
string(3) "abd"
--- testing: '123abc' ---
string(6) "123abd"
--- testing: '123e5' ---
float(12300001)
--- testing: '123e5xyz' ---
string(8) "123e5xza"
--- testing: ' 123abc' ---

Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d
string(7) " 123abd"
--- testing: '123 abc' ---

Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d
string(7) "123 abd"
--- testing: '123abc ' ---

Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d
string(7) "123abc "
--- testing: '3.4a' ---

Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d
string(4) "3.4b"
--- testing: 'a5.9' ---

Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d
string(4) "a5.0"
--- testing: 'z' ---
string(2) "aa"
--- testing: 'az' ---
string(2) "ba"
--- testing: 'zz' ---
string(3) "aaa"
--- testing: 'Z' ---
string(2) "AA"
--- testing: 'AZ' ---
string(2) "BA"
--- testing: 'ZZ' ---
string(3) "AAA"
--- testing: '9z' ---
string(3) "10a"
--- testing: '19z' ---
string(3) "20a"
--- testing: '99z' ---
string(4) "100a"