I tried it, and the results returned by var_dump were all NUll. Baidu also found no clear answer.
I saw that return '' seems to be used more often in the code written by others. Could you please tell me about return '' and return in PHP. What's the difference?
世界只因有你2017-05-31 10:36:30
return '' returns an empty string
return returns null
You can see it through the var_dump result.
For PHP's weakly typed language, there is actually no difference if you don't use it carefully.
But using ===
, the comparison will show false
迷茫2017-05-31 10:36:30
I think generally don’t return null, return an empty string or empty array, so that the data acquisition party can process it uniformly (less judgment (~—~))