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===DONE=== 20--EXPECT-- 21--- testing: '0' --- 22int(-1) 23--- testing: '65' --- 24int(64) 25--- testing: '-44' --- 26int(-45) 27--- testing: '1.2' --- 28float(0.2) 29--- testing: '-7.7' --- 30float(-8.7) 31--- testing: 'abc' --- 32string(3) "abc" 33--- testing: '123abc' --- 34string(6) "123abc" 35--- testing: '123e5' --- 36float(12299999) 37--- testing: '123e5xyz' --- 38string(8) "123e5xyz" 39--- testing: ' 123abc' --- 40string(7) " 123abc" 41--- testing: '123 abc' --- 42string(7) "123 abc" 43--- testing: '123abc ' --- 44string(7) "123abc " 45--- testing: '3.4a' --- 46string(4) "3.4a" 47--- testing: 'a5.9' --- 48string(4) "a5.9" 49===DONE=== 50