Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In PHP you can use === and !== operators to check not only if the values are equal but also if their types match. So for example: <code>0 == false</code> is <code>true</code>, but <code>0 === false</code> is <code>false</code>. The same goes for <code>!=</code> versus <code>!==</code>. Also in case you compare <code>null</code> to the other two using the mentioned operators, expect similar results.</p> <p>Now in PHP this quality of values is usually used when returning a value which sometimes can be <code>0</code> (zero), but sometimes it might be that the function failed. In such cases in PHP you return <code>false</code> and you have to check for these cases using the identity operator <code>===</code>. For example if you are searching for a position of one string inside the other and you're using <code>strpos()</code>, this function will return the numeric position which can be 0 if the string is found at the very beginning, but if the string is not found at all, then <code>strpos()</code> will return <code>false</code> and you have to take this into account when dealing with the result.</p> <p>If you will use the same technique in your functions, anybody familiar with the standard PHP library will understand what is going on and how to check if the returned value is what is wanted or did some error occur while processing. The same actually goes for function params, you can process them differently depending on if they are arrays or strings or what not, and this technique is used throughout PHP heavily too, so everybody will get it quite easily. So I guess that's the power.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload