


php-Is my understanding correct? The reason why $b outputs 1 is because $a defaults to 0?
Aug 10, 2016 am 08:49 AMphp
1
2
<?phpfunction test (&
$b
){
$b
++;
echo
$b
.'';
}test(
$a
);
$a
=100;
echo
$a
;
Copy after login
Reply content:
This code has been changed to better understand the changes in $a:
1 2 3 4 5 6 7 8 9 10 |
|
Yes, php will initialize a default value for unassigned code. For integers, This value is 0
The initialization value is the same as java.
What should I pay attention to when studying? I think the most important thing is to apply what you have learned, practice more, and write some code that has practical significance. Don’t write too much helloworld-level code, let alone go overboard and create some weird test programs, and pay more attention to real-world problems. .
The above is php - is my understanding correct? The reason why $b outputs 1 is because $a defaults to 0? For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
