$a = 2 + 1;
$a = isset($a) ? $a : false;
$a = func1($a) + func2($a);
$res = mysql_query($query);
2 + 1;
isset($a) ? $a : false;
func1($a) + func2($a);
mysql_query($query);
$a = ($b = 2 + 1);
$a = isset($a) ? $b = $a : $b = false;
$a = ($b = func1($a)) + func2($a);
$a = mysql_query($query = ‘SELECT …’);
// $a == true func1() func2()
$a ? func1() : func2();
// func1() func2() :
func1() + func2();
// func1() func2() $a > 0
$a <= 0 or func1() + func2();
$a = true or func1();
$a = false and func1();
Func1() or func2() or func3();
$res = mysql_connect(…);
if (!$res) die();
$res = mysql_connect(…) or die();
mysql_connect(…) and mysql_select_db (…) and mysql_query("SET NAMES utf8") or die(mysql_error());
$res = mysql_query(“SELECT …”);
If ($res) while ($v = mysql_fetch_assoc($res))
{
// - .
}
for($res = mysql_query(“SELECT …”); $res&&($v = mysql_fetch_assoc($res));)
{
// - .
}
for(
$res = mysql_query(“SELECT …”);
$res && ($v = mysql_fetch_assoc($res));
// - ,
print_r($v)
);
for(
$res = mysql_query(“SELECT …”), $i = 0;
$res && ($v = mysql_fetch_assoc($res));
// - ,
print_r($i++), print_r($v)
);
if (is_file(DIR1.$file)) $path = DIR1.$file;
elseif (is_file(DIR2.$file)) $path = DIR2.$file;
else $path = false;
is_file($path = DIR1.$file) || is_file($path = DIR2.$file) || $path = false;
Source: https://habr.com/ru/post/38639/
All Articles