亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

在Ruby中為什么$a和@a返回的是nil?
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-04-25 09:03:55
0
2
1351

不應(yīng)該是報(bào)錯(cuò)么?

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證0級(jí)講師

reply all(2)
大家講道理

Uninitialized global variables and instance variables have default values ??of nil.
You can take a look at the documentation:
http://www.rubyist.net/~slage...

Before initialization, a global variable has the special value nil.

http://www.rubyist.net/~slage...

instance variables have the nil value until they are initialized.

給我你的懷抱

Accessing an uninitialized variable returns nil, and nil can be regarded as an error.

Why? Because it is convenient, it is so troublesome to report errors every time and deal with them. Also, you are an awesome programmer, capable of using programming languages ??well, and will not screw up the program because of nil (??????)??, so I won’t report an error.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template