diff options
author | Nikita Popov <nikic@php.net> | 2014-09-05 12:44:51 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2014-09-05 12:45:42 +0200 |
commit | 828fe353817c78cec2ceb7c42ff0644069f46ba7 (patch) | |
tree | aca98b0da2d90cb64c3c552d6289e781d1aed1fb /tests | |
parent | 9a420f0361243e0aa42f93fd996c8f2f133c20cc (diff) | |
download | php-git-828fe353817c78cec2ceb7c42ff0644069f46ba7.tar.gz |
Fix string increment
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/operators/preinc_variationStr.phpt | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/tests/lang/operators/preinc_variationStr.phpt b/tests/lang/operators/preinc_variationStr.phpt index 010a237034..4e607057f7 100644 --- a/tests/lang/operators/preinc_variationStr.phpt +++ b/tests/lang/operators/preinc_variationStr.phpt @@ -1,22 +1,23 @@ ---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"
-);
-
-
-foreach ($strVals as $strVal) {
- echo "--- testing: '$strVal' ---\n";
- var_dump(++$strVal);
-}
-
-?>
-===DONE===
---EXPECT--
+--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); +} + +?> +===DONE=== +--EXPECT-- --- testing: '0' --- int(1) --- testing: '65' --- @@ -44,5 +45,23 @@ string(7) "123abc " --- testing: '3.4a' --- string(4) "3.4b" --- testing: 'a5.9' --- -string(4) "a5.0"
-===DONE===
+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" +===DONE=== |