Home >Backend Development >PHP Tutorial >php-初学PHP,想请教。。。

php-初学PHP,想请教。。。

WBOY
WBOYOriginal
2016-06-02 11:32:07912browse

php

$s=$s+1与++$s应该是等同的吧,为何以下两段代码的结果不一样呢?

代码一:

$s='a';
++$s;
echo $s;

代码二:

$s='a';
$s=$s+1;
echo $s;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn