1--TEST--
2Test --N operator : various numbers as strings
3--FILE--
4<?php
5
6$strVals = array(
7   "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
8   "a5.9"
9);
10
11
12foreach ($strVals as $strVal) {
13   echo "--- testing: '$strVal' ---\n";
14   var_dump(--$strVal);
15}
16
17?>
18--EXPECTF--
19--- testing: '0' ---
20int(-1)
21--- testing: '65' ---
22int(64)
23--- testing: '-44' ---
24int(-45)
25--- testing: '1.2' ---
26float(0.19999999999999996)
27--- testing: '-7.7' ---
28float(-8.7)
29--- testing: 'abc' ---
30
31Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
32string(3) "abc"
33--- testing: '123abc' ---
34
35Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
36string(6) "123abc"
37--- testing: '123e5' ---
38float(12299999)
39--- testing: '123e5xyz' ---
40
41Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
42string(8) "123e5xyz"
43--- testing: ' 123abc' ---
44
45Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
46string(7) " 123abc"
47--- testing: '123 abc' ---
48
49Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
50string(7) "123 abc"
51--- testing: '123abc ' ---
52
53Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
54string(7) "123abc "
55--- testing: '3.4a' ---
56
57Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
58string(4) "3.4a"
59--- testing: 'a5.9' ---
60
61Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
62string(4) "a5.9"
63