Description of isset and description of isset

Source: Internet
Author: User

Description of isset and description of isset

Author: zhanhailiang Date:

Today I encountered a very strange bug. The test is as follows:

<? Php $ a = 'abc'; var_dump (isset ($ a ['code']); // theoretically it should be False, but it is TRUE

Check the following manual description:

Example #2 isset() on String Offsets PHP 5.4 changes how isset() behaves when passed string offsets.  <?php$expected_array_got_string = 'somestring';var_dump(isset($expected_array_got_string['some_key']));var_dump(isset($expected_array_got_string[0]));var_dump(isset($expected_array_got_string['0']));var_dump(isset($expected_array_got_string[0.5]));var_dump(isset($expected_array_got_string['0.5']));var_dump(isset($expected_array_got_string['0 Mostel']));?> Output of the above example in PHP 5.3: bool(true)bool(true)bool(true)bool(true)bool(true)bool(true)Output of the above example in PHP 5.4: bool(false)bool(true)bool(true)bool(true)bool(false)bool(false)

Summary: Before using isset, it is best to use is_array/is_string to determine the variable type to avoid inconsistency in different PHP versions,In the old saying, PHP is a weak language, but the weak type does not indicate no type., As follows:

<?php $a = 'abc';var_dump(is_array($a) && isset($a['code']));

What is "a point" in "A Little Bit Of Feihong film" in Tianjing Sha Qiu?

Sunset in the village,
Cow,
A little Feihong film.
Qingshan,
White grass, red leaves, yellow flowers.

Feihong described it as "a little" and clearly described it from the perspective of vision. "a little" provided an open and profound artistic conception.
At the same time, I wrote the artistic conception of loneliness in a 'point' manner. In the sunset, the old crow was far more powerful.
Yidian' is more profound in "a little photo of Feihong .---
Pay attention to the last two statements,
White grass, red leaves, yellow flowers.

"A little Feihong shadow" is to write "Qingshan green water, white grass, red leaves, yellow flowers ". The mood suddenly changes and the flowers bloom in the spring. This alone is obviously very complex. It is not difficult to see the purpose of Feihong's film. In the desert, there is another hope for him, infinite yearning.
Therefore, I wrote my ambition, which is unknown to most people.

A better personal explanation

Self-pity that cannot be restrained. I have nothing to do with tranquility. Non-Customs love light look, cold place is preferred. It is not a rich flower in the world. Suddenly, you only want to have a hug. The world is changing. More smiles are just far-fetched.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.