This expression depends on how or works. It is usually used to check if one of two logical values ββis true:
$foo = true or false // true $foo = false or false // false
Itβs great that if the left side of or is true, it never checks the last part, because it does not need it. This means that you can put an expression on each side of or . If the left side results in a negative value (a value that resolves to false ), then the right side will be executed. If the left side results in a positive value that allows true, then the right side will never be executed.
So, to summarize, this is:
ini_get('session.auto_start') or session_start();
identical to this:
if(!ini_get('session.auto_start')) session_start();
since ini_get('session.auto_start') leads to either 0 or 1 , which evaluates to false and true respectively.
Hubro source share