In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the difference between PHP5.5 and the previous version of empty function". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the difference between PHP5.5 and the previous version of empty function?"
The copy code is as follows:
If (strlen ($passwd) < 6 | | empty ($preg_replace ("/\ d /", ", $passwd) {
/ / do something
}
The general meaning is that the password must be greater than 6 digits and cannot be made up of only numbers. Search the server log and find the following error:
The copy code is as follows:
PHP Fatal error: Can't use function return value in write context in / xxx/xxx/xx.php on line xxx
Google a bit, which probably means that the argument to empty cannot be a function. Shit, the local area is obviously good. Take a look at the local PHP is 5.5, the server is 5.3. Does this function evolve between two versions? After searching all the PHP official documents, there was nothing to be found. Then google searched furiously and accidentally clicked to the PHP English document interface. Under the introduction of the empty function, a small print was found:
The copy code is as follows:
Note:
Prior to PHP 5.5, empty () only supports variables; anything else will result in a parse error. In other words, the following will not work: empty (trim ($name)). Instead, use trim ($name) = = false.
Summarize the usage scenarios of empty function:
Prior to 1.PHP 5.5, this function is used to check whether the assignment of a variable is 0, false, empty string, null. Any parameter in the form of a non-variable causes an error in this function.
2.PHP 5.5 this function can be applied to any value, not limited to variables. You can return values for constants, functions, and so on.
Thank you for your reading, the above is the "PHP5.5 and the previous version of the empty function is different" of the content, after the study of this article, I believe you have a deeper understanding of PHP5.5 and the previous version of the empty function has a deeper understanding of the specific use of the need for you to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.