Annotation of embedaddon/php/tests/lang/operators/modulus_variationStr.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test % 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: error_reporting(E_ERROR);
                     12: 
                     13: foreach ($strVals as $strVal) {
                     14:    foreach($strVals as $otherVal) {
                     15:           echo "--- testing: '$strVal' % '$otherVal' ---\n";   
                     16:       var_dump($strVal%$otherVal);
                     17:    }
                     18: }
                     19: 
                     20:    
                     21: ?>
                     22: ===DONE===
                     23: --EXPECT--
                     24: --- testing: '0' % '0' ---
                     25: bool(false)
                     26: --- testing: '0' % '65' ---
                     27: int(0)
                     28: --- testing: '0' % '-44' ---
                     29: int(0)
                     30: --- testing: '0' % '1.2' ---
                     31: int(0)
                     32: --- testing: '0' % '-7.7' ---
                     33: int(0)
                     34: --- testing: '0' % 'abc' ---
                     35: bool(false)
                     36: --- testing: '0' % '123abc' ---
                     37: int(0)
                     38: --- testing: '0' % '123e5' ---
                     39: int(0)
                     40: --- testing: '0' % '123e5xyz' ---
                     41: int(0)
                     42: --- testing: '0' % ' 123abc' ---
                     43: int(0)
                     44: --- testing: '0' % '123 abc' ---
                     45: int(0)
                     46: --- testing: '0' % '123abc ' ---
                     47: int(0)
                     48: --- testing: '0' % '3.4a' ---
                     49: int(0)
                     50: --- testing: '0' % 'a5.9' ---
                     51: bool(false)
                     52: --- testing: '65' % '0' ---
                     53: bool(false)
                     54: --- testing: '65' % '65' ---
                     55: int(0)
                     56: --- testing: '65' % '-44' ---
                     57: int(21)
                     58: --- testing: '65' % '1.2' ---
                     59: int(0)
                     60: --- testing: '65' % '-7.7' ---
                     61: int(2)
                     62: --- testing: '65' % 'abc' ---
                     63: bool(false)
                     64: --- testing: '65' % '123abc' ---
                     65: int(65)
                     66: --- testing: '65' % '123e5' ---
                     67: int(65)
                     68: --- testing: '65' % '123e5xyz' ---
                     69: int(65)
                     70: --- testing: '65' % ' 123abc' ---
                     71: int(65)
                     72: --- testing: '65' % '123 abc' ---
                     73: int(65)
                     74: --- testing: '65' % '123abc ' ---
                     75: int(65)
                     76: --- testing: '65' % '3.4a' ---
                     77: int(2)
                     78: --- testing: '65' % 'a5.9' ---
                     79: bool(false)
                     80: --- testing: '-44' % '0' ---
                     81: bool(false)
                     82: --- testing: '-44' % '65' ---
                     83: int(-44)
                     84: --- testing: '-44' % '-44' ---
                     85: int(0)
                     86: --- testing: '-44' % '1.2' ---
                     87: int(0)
                     88: --- testing: '-44' % '-7.7' ---
                     89: int(-2)
                     90: --- testing: '-44' % 'abc' ---
                     91: bool(false)
                     92: --- testing: '-44' % '123abc' ---
                     93: int(-44)
                     94: --- testing: '-44' % '123e5' ---
                     95: int(-44)
                     96: --- testing: '-44' % '123e5xyz' ---
                     97: int(-44)
                     98: --- testing: '-44' % ' 123abc' ---
                     99: int(-44)
                    100: --- testing: '-44' % '123 abc' ---
                    101: int(-44)
                    102: --- testing: '-44' % '123abc ' ---
                    103: int(-44)
                    104: --- testing: '-44' % '3.4a' ---
                    105: int(-2)
                    106: --- testing: '-44' % 'a5.9' ---
                    107: bool(false)
                    108: --- testing: '1.2' % '0' ---
                    109: bool(false)
                    110: --- testing: '1.2' % '65' ---
                    111: int(1)
                    112: --- testing: '1.2' % '-44' ---
                    113: int(1)
                    114: --- testing: '1.2' % '1.2' ---
                    115: int(0)
                    116: --- testing: '1.2' % '-7.7' ---
                    117: int(1)
                    118: --- testing: '1.2' % 'abc' ---
                    119: bool(false)
                    120: --- testing: '1.2' % '123abc' ---
                    121: int(1)
                    122: --- testing: '1.2' % '123e5' ---
                    123: int(1)
                    124: --- testing: '1.2' % '123e5xyz' ---
                    125: int(1)
                    126: --- testing: '1.2' % ' 123abc' ---
                    127: int(1)
                    128: --- testing: '1.2' % '123 abc' ---
                    129: int(1)
                    130: --- testing: '1.2' % '123abc ' ---
                    131: int(1)
                    132: --- testing: '1.2' % '3.4a' ---
                    133: int(1)
                    134: --- testing: '1.2' % 'a5.9' ---
                    135: bool(false)
                    136: --- testing: '-7.7' % '0' ---
                    137: bool(false)
                    138: --- testing: '-7.7' % '65' ---
                    139: int(-7)
                    140: --- testing: '-7.7' % '-44' ---
                    141: int(-7)
                    142: --- testing: '-7.7' % '1.2' ---
                    143: int(0)
                    144: --- testing: '-7.7' % '-7.7' ---
                    145: int(0)
                    146: --- testing: '-7.7' % 'abc' ---
                    147: bool(false)
                    148: --- testing: '-7.7' % '123abc' ---
                    149: int(-7)
                    150: --- testing: '-7.7' % '123e5' ---
                    151: int(-7)
                    152: --- testing: '-7.7' % '123e5xyz' ---
                    153: int(-7)
                    154: --- testing: '-7.7' % ' 123abc' ---
                    155: int(-7)
                    156: --- testing: '-7.7' % '123 abc' ---
                    157: int(-7)
                    158: --- testing: '-7.7' % '123abc ' ---
                    159: int(-7)
                    160: --- testing: '-7.7' % '3.4a' ---
                    161: int(-1)
                    162: --- testing: '-7.7' % 'a5.9' ---
                    163: bool(false)
                    164: --- testing: 'abc' % '0' ---
                    165: bool(false)
                    166: --- testing: 'abc' % '65' ---
                    167: int(0)
                    168: --- testing: 'abc' % '-44' ---
                    169: int(0)
                    170: --- testing: 'abc' % '1.2' ---
                    171: int(0)
                    172: --- testing: 'abc' % '-7.7' ---
                    173: int(0)
                    174: --- testing: 'abc' % 'abc' ---
                    175: bool(false)
                    176: --- testing: 'abc' % '123abc' ---
                    177: int(0)
                    178: --- testing: 'abc' % '123e5' ---
                    179: int(0)
                    180: --- testing: 'abc' % '123e5xyz' ---
                    181: int(0)
                    182: --- testing: 'abc' % ' 123abc' ---
                    183: int(0)
                    184: --- testing: 'abc' % '123 abc' ---
                    185: int(0)
                    186: --- testing: 'abc' % '123abc ' ---
                    187: int(0)
                    188: --- testing: 'abc' % '3.4a' ---
                    189: int(0)
                    190: --- testing: 'abc' % 'a5.9' ---
                    191: bool(false)
                    192: --- testing: '123abc' % '0' ---
                    193: bool(false)
                    194: --- testing: '123abc' % '65' ---
                    195: int(58)
                    196: --- testing: '123abc' % '-44' ---
                    197: int(35)
                    198: --- testing: '123abc' % '1.2' ---
                    199: int(0)
                    200: --- testing: '123abc' % '-7.7' ---
                    201: int(4)
                    202: --- testing: '123abc' % 'abc' ---
                    203: bool(false)
                    204: --- testing: '123abc' % '123abc' ---
                    205: int(0)
                    206: --- testing: '123abc' % '123e5' ---
                    207: int(0)
                    208: --- testing: '123abc' % '123e5xyz' ---
                    209: int(0)
                    210: --- testing: '123abc' % ' 123abc' ---
                    211: int(0)
                    212: --- testing: '123abc' % '123 abc' ---
                    213: int(0)
                    214: --- testing: '123abc' % '123abc ' ---
                    215: int(0)
                    216: --- testing: '123abc' % '3.4a' ---
                    217: int(0)
                    218: --- testing: '123abc' % 'a5.9' ---
                    219: bool(false)
                    220: --- testing: '123e5' % '0' ---
                    221: bool(false)
                    222: --- testing: '123e5' % '65' ---
                    223: int(58)
                    224: --- testing: '123e5' % '-44' ---
                    225: int(35)
                    226: --- testing: '123e5' % '1.2' ---
                    227: int(0)
                    228: --- testing: '123e5' % '-7.7' ---
                    229: int(4)
                    230: --- testing: '123e5' % 'abc' ---
                    231: bool(false)
                    232: --- testing: '123e5' % '123abc' ---
                    233: int(0)
                    234: --- testing: '123e5' % '123e5' ---
                    235: int(0)
                    236: --- testing: '123e5' % '123e5xyz' ---
                    237: int(0)
                    238: --- testing: '123e5' % ' 123abc' ---
                    239: int(0)
                    240: --- testing: '123e5' % '123 abc' ---
                    241: int(0)
                    242: --- testing: '123e5' % '123abc ' ---
                    243: int(0)
                    244: --- testing: '123e5' % '3.4a' ---
                    245: int(0)
                    246: --- testing: '123e5' % 'a5.9' ---
                    247: bool(false)
                    248: --- testing: '123e5xyz' % '0' ---
                    249: bool(false)
                    250: --- testing: '123e5xyz' % '65' ---
                    251: int(58)
                    252: --- testing: '123e5xyz' % '-44' ---
                    253: int(35)
                    254: --- testing: '123e5xyz' % '1.2' ---
                    255: int(0)
                    256: --- testing: '123e5xyz' % '-7.7' ---
                    257: int(4)
                    258: --- testing: '123e5xyz' % 'abc' ---
                    259: bool(false)
                    260: --- testing: '123e5xyz' % '123abc' ---
                    261: int(0)
                    262: --- testing: '123e5xyz' % '123e5' ---
                    263: int(0)
                    264: --- testing: '123e5xyz' % '123e5xyz' ---
                    265: int(0)
                    266: --- testing: '123e5xyz' % ' 123abc' ---
                    267: int(0)
                    268: --- testing: '123e5xyz' % '123 abc' ---
                    269: int(0)
                    270: --- testing: '123e5xyz' % '123abc ' ---
                    271: int(0)
                    272: --- testing: '123e5xyz' % '3.4a' ---
                    273: int(0)
                    274: --- testing: '123e5xyz' % 'a5.9' ---
                    275: bool(false)
                    276: --- testing: ' 123abc' % '0' ---
                    277: bool(false)
                    278: --- testing: ' 123abc' % '65' ---
                    279: int(58)
                    280: --- testing: ' 123abc' % '-44' ---
                    281: int(35)
                    282: --- testing: ' 123abc' % '1.2' ---
                    283: int(0)
                    284: --- testing: ' 123abc' % '-7.7' ---
                    285: int(4)
                    286: --- testing: ' 123abc' % 'abc' ---
                    287: bool(false)
                    288: --- testing: ' 123abc' % '123abc' ---
                    289: int(0)
                    290: --- testing: ' 123abc' % '123e5' ---
                    291: int(0)
                    292: --- testing: ' 123abc' % '123e5xyz' ---
                    293: int(0)
                    294: --- testing: ' 123abc' % ' 123abc' ---
                    295: int(0)
                    296: --- testing: ' 123abc' % '123 abc' ---
                    297: int(0)
                    298: --- testing: ' 123abc' % '123abc ' ---
                    299: int(0)
                    300: --- testing: ' 123abc' % '3.4a' ---
                    301: int(0)
                    302: --- testing: ' 123abc' % 'a5.9' ---
                    303: bool(false)
                    304: --- testing: '123 abc' % '0' ---
                    305: bool(false)
                    306: --- testing: '123 abc' % '65' ---
                    307: int(58)
                    308: --- testing: '123 abc' % '-44' ---
                    309: int(35)
                    310: --- testing: '123 abc' % '1.2' ---
                    311: int(0)
                    312: --- testing: '123 abc' % '-7.7' ---
                    313: int(4)
                    314: --- testing: '123 abc' % 'abc' ---
                    315: bool(false)
                    316: --- testing: '123 abc' % '123abc' ---
                    317: int(0)
                    318: --- testing: '123 abc' % '123e5' ---
                    319: int(0)
                    320: --- testing: '123 abc' % '123e5xyz' ---
                    321: int(0)
                    322: --- testing: '123 abc' % ' 123abc' ---
                    323: int(0)
                    324: --- testing: '123 abc' % '123 abc' ---
                    325: int(0)
                    326: --- testing: '123 abc' % '123abc ' ---
                    327: int(0)
                    328: --- testing: '123 abc' % '3.4a' ---
                    329: int(0)
                    330: --- testing: '123 abc' % 'a5.9' ---
                    331: bool(false)
                    332: --- testing: '123abc ' % '0' ---
                    333: bool(false)
                    334: --- testing: '123abc ' % '65' ---
                    335: int(58)
                    336: --- testing: '123abc ' % '-44' ---
                    337: int(35)
                    338: --- testing: '123abc ' % '1.2' ---
                    339: int(0)
                    340: --- testing: '123abc ' % '-7.7' ---
                    341: int(4)
                    342: --- testing: '123abc ' % 'abc' ---
                    343: bool(false)
                    344: --- testing: '123abc ' % '123abc' ---
                    345: int(0)
                    346: --- testing: '123abc ' % '123e5' ---
                    347: int(0)
                    348: --- testing: '123abc ' % '123e5xyz' ---
                    349: int(0)
                    350: --- testing: '123abc ' % ' 123abc' ---
                    351: int(0)
                    352: --- testing: '123abc ' % '123 abc' ---
                    353: int(0)
                    354: --- testing: '123abc ' % '123abc ' ---
                    355: int(0)
                    356: --- testing: '123abc ' % '3.4a' ---
                    357: int(0)
                    358: --- testing: '123abc ' % 'a5.9' ---
                    359: bool(false)
                    360: --- testing: '3.4a' % '0' ---
                    361: bool(false)
                    362: --- testing: '3.4a' % '65' ---
                    363: int(3)
                    364: --- testing: '3.4a' % '-44' ---
                    365: int(3)
                    366: --- testing: '3.4a' % '1.2' ---
                    367: int(0)
                    368: --- testing: '3.4a' % '-7.7' ---
                    369: int(3)
                    370: --- testing: '3.4a' % 'abc' ---
                    371: bool(false)
                    372: --- testing: '3.4a' % '123abc' ---
                    373: int(3)
                    374: --- testing: '3.4a' % '123e5' ---
                    375: int(3)
                    376: --- testing: '3.4a' % '123e5xyz' ---
                    377: int(3)
                    378: --- testing: '3.4a' % ' 123abc' ---
                    379: int(3)
                    380: --- testing: '3.4a' % '123 abc' ---
                    381: int(3)
                    382: --- testing: '3.4a' % '123abc ' ---
                    383: int(3)
                    384: --- testing: '3.4a' % '3.4a' ---
                    385: int(0)
                    386: --- testing: '3.4a' % 'a5.9' ---
                    387: bool(false)
                    388: --- testing: 'a5.9' % '0' ---
                    389: bool(false)
                    390: --- testing: 'a5.9' % '65' ---
                    391: int(0)
                    392: --- testing: 'a5.9' % '-44' ---
                    393: int(0)
                    394: --- testing: 'a5.9' % '1.2' ---
                    395: int(0)
                    396: --- testing: 'a5.9' % '-7.7' ---
                    397: int(0)
                    398: --- testing: 'a5.9' % 'abc' ---
                    399: bool(false)
                    400: --- testing: 'a5.9' % '123abc' ---
                    401: int(0)
                    402: --- testing: 'a5.9' % '123e5' ---
                    403: int(0)
                    404: --- testing: 'a5.9' % '123e5xyz' ---
                    405: int(0)
                    406: --- testing: 'a5.9' % ' 123abc' ---
                    407: int(0)
                    408: --- testing: 'a5.9' % '123 abc' ---
                    409: int(0)
                    410: --- testing: 'a5.9' % '123abc ' ---
                    411: int(0)
                    412: --- testing: 'a5.9' % '3.4a' ---
                    413: int(0)
                    414: --- testing: 'a5.9' % 'a5.9' ---
                    415: bool(false)
                    416: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>