在php7中,千万不要把你的??当成三元运算符使用!!!
<?php
$tmparr = ['cover'=>'http://img.kevinfei.com.cn'];
echo isset($tmparr['cover'])."\n";
echo !empty($tmparr['cover'])."\n";
$rep = isset($tmparr['cover']) && !empty($tmparr['cover']) ? $tmparr['cover'] : '';
var_dump($rep);
$result = isset($tmparr['cover']) && !empty($tmparr['cover']) ?? '';
var_dump($result);
// 1
// 1
// string(24) "http://img.kevinfei.com.cn"
// bool(true)
?>
php7新增一个运算符
??
,不知道大家平时是在什么时候用它,但是我一直用它代替以前的三元运算符? :
,今天偶然发现,它和三元运算符是不一样的,.在想用
??
判断一个赋值为0
的变量的时候要小心了,结果可能和想象中的不一样从上面的结果可以看出,在php7中 ?? 代表isset ?: 代表empty
今天想告诉大家在php7中关于这个几个最常用的内置函数而可能会引发的问题,需要注意一下啊!!!
I inaugurate a uncommonly steaming video! If you are looking with a view the same, meet to xxx
Hey There. I found your weblog the use of msn. This is an extremely smartly written article. I'll make sure to bookmark it and return to learn extra of your helpful information. Thanks for the post. I'll definitely comeback.
I am in fact happy to glance at this website posts which includes tons of useful information, thanks for providing these kinds of data.
Your style is so unique compared to other people I've read stuff from. Many thanks for posting when you have the opportunity, Guess I will just bookmark this blog.
I believe that is one of the so much significant information for me. And i am glad reading your article. But should remark on few basic issues, The website taste is ideal, the articles is really nice : D. Just right task, cheers
Right now it seems like Movable Type is the preferred blogging platform available right now. (from what I've read) Is that what you are using on your blog?
Fenomega ile instagram aylık beğeni satın almak ve tüm paylaşımlarınıza yada belirtilen sayıdaki paylaşımlarınız için özel https://cutt.ly/QSWJRyg aylık beğeni satın al
This paragraph provides clear idea in support of the new viewers of blogging, that actually how to do blogging and site-building.
Wow, this paragraph is pleasant, my sister is analyzing such things, thus I am going to convey her.
I don't even know how I finished up here, however I assumed this publish was great. I don't realize who you are but certainly you are going to a well-known blogger if you happen to aren't already. Cheers!
Excellent site. Plenty of helpful information here. I am sending it to several buddies ans additionally sharing in delicious. And of course, thank you in your effort!
I am truly delighted to read this website posts which consists of plenty of useful data, thanks for providing these kinds of statistics.
I have read some excellent stuff here. Definitely value bookmarking for revisiting. I wonder how so much effort you put to make the sort of great informative web site.
What's Taking place i'm new to this, I stumbled upon this I've discovered It absolutely helpful and it has helped me out loads. I hope to contribute & assist other users like its helped me. Great job.
It's actually a great and useful piece of info. I'm satisfied that you simply shared this useful information with us. Please keep us up to date like this. Thanks for sharing.
İnternetteki bahis siteleri hakkındaki en önemli detaylardan biri de güvenlik özellikleridir. Güvenli bahis platformları hakkında bilgileri arayan kullanıcılar için BahisKrallığı sitemizdeki paylaşımlar öne çıkıyor.
BahisDurağı web sitesinde bahis tutkunları için en doğru kaynaklar yer alır. Bahis oyuncularına rehberlik eden sitede bahis opsiyonları, güncel bahis seçenekleri, maç analizlerinin yer aldığı siteler hakkında bilgiler mevcut.
Keep on working, great job!