-
-
Save WoZ/1810148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ниже пример, когда существенно превышает длина строки 80 символов | |
// тут строка короче, но смысл тот же | |
// Вариант 1 | |
if (! $memcache->waitForUnlock($mKey) | |
|| ! $b0 = $memcache->get($mKey) | |
) { | |
$memcache->log("$mKey unlocked but cache is empty"); | |
$b0 = null; | |
} | |
// Вариант 2 | |
if (! $memcache->waitForUnlock($mKey) | |
|| ! $b0 = $memcache->get($mKey)) | |
{ | |
$memcache->log("$mKey unlocked but cache is empty"); | |
$b0 = null; | |
} | |
// Вариант 3 | |
if (! $memcache->waitForUnlock($mKey) | |
|| ! $b0 = $memcache->get($mKey)) { | |
$memcache->log("$mKey unlocked but cache is empty"); | |
$b0 = null; | |
} | |
// Третий вариант, как раз, менее читаем чем первый и второй | |
// альтернативный вариант | |
// Вариант 4 | |
if ( | |
! $memcache->waitForUnlock($mKey) | |
|| ! $b0 = $memcache->get($mKey) | |
) { | |
$memcache->log("$mKey unlocked but cache is empty"); | |
$b0 = null; | |
} | |
// Вариант 5 | |
if ( | |
! $memcache->waitForUnlock($mKey) | |
|| ! $b0 = $memcache->get($mKey) | |
) | |
{ | |
$memcache->log("$mKey unlocked but cache is empty"); | |
$b0 = null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment