Home > Backend Development > PHP Tutorial > php中的 (unset) 类型转换

php中的 (unset) 类型转换

WBOY
Release: 2016-06-06 20:34:57
Original
1089 people have browsed it

<code>php</code><code>$str = 'hello world';

var_dump((unset) $str);
var_dump($str);
</code>
Copy after login
Copy after login

有同学知道这个使用场景么?

回复内容:

<code>php</code><code>$str = 'hello world';

var_dump((unset) $str);
var_dump($str);
</code>
Copy after login
Copy after login

有同学知道这个使用场景么?

然而并没有什么卵用。。和直接写null没有毛线区别,个人猜测仅仅是因为类型里有null,所以转换也来个转成null,but why it's (unset) instead of (null),我只能说,who tama knows.

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template