Created
March 14, 2012 03:06
-
-
Save sofish/2033716 to your computer and use it in GitHub Desktop.
连字符串也可以++/--
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function a() { | |
| static $b = 'abc'; // 中文就不行了,写“你妹”会打印出来2个"你妹" | |
| echo $b . PHP_EOL; | |
| $b++; | |
| } | |
| a(); | |
| a(); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
因为字母会转换成在ASCII里与之对应的数字。