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   $strVal--;
15   var_dump($strVal);
16}
17
18?>
19--EXPECTF--
20--- testing: '0' ---
21int(-1)
22--- testing: '65' ---
23int(64)
24--- testing: '-44' ---
25int(-45)
26--- testing: '1.2' ---
27float(0.19999999999999996)
28--- testing: '-7.7' ---
29float(-8.7)
30--- testing: 'abc' ---
31
32Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
33string(3) "abc"
34--- testing: '123abc' ---
35
36Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
37string(6) "123abc"
38--- testing: '123e5' ---
39float(12299999)
40--- testing: '123e5xyz' ---
41
42Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
43string(8) "123e5xyz"
44--- testing: ' 123abc' ---
45
46Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
47string(7) " 123abc"
48--- testing: '123 abc' ---
49
50Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
51string(7) "123 abc"
52--- testing: '123abc ' ---
53
54Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
55string(7) "123abc "
56--- testing: '3.4a' ---
57
58Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
59string(4) "3.4a"
60--- testing: 'a5.9' ---
61
62Deprecated: Decrement on non-numeric string has no effect and is deprecated %s on line %d
63string(4) "a5.9"
64