File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / lang / operators / postinc_variationStr.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Test 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: 
   12: foreach ($strVals as $strVal) {
   13:    echo "--- testing: '$strVal' ---\n";
   14:    $strVal++;
   15:    var_dump($strVal);
   16: }
   17:    
   18: ?>
   19: ===DONE===
   20: --EXPECT--
   21: --- testing: '0' ---
   22: int(1)
   23: --- testing: '65' ---
   24: int(66)
   25: --- testing: '-44' ---
   26: int(-43)
   27: --- testing: '1.2' ---
   28: float(2.2)
   29: --- testing: '-7.7' ---
   30: float(-6.7)
   31: --- testing: 'abc' ---
   32: string(3) "abd"
   33: --- testing: '123abc' ---
   34: string(6) "123abd"
   35: --- testing: '123e5' ---
   36: float(12300001)
   37: --- testing: '123e5xyz' ---
   38: string(8) "123e5xza"
   39: --- testing: ' 123abc' ---
   40: string(7) " 123abd"
   41: --- testing: '123 abc' ---
   42: string(7) "123 abd"
   43: --- testing: '123abc ' ---
   44: string(7) "123abc "
   45: --- testing: '3.4a' ---
   46: string(4) "3.4b"
   47: --- testing: 'a5.9' ---
   48: string(4) "a5.0"
   49: ===DONE===

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