Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 149022 программиста и 7896 роботов. Сейчас ищут 3566 программистов ...

Ternary operators

Вернуться к: Coding standard enhancements

Ternary operators

The same rule as for if clauses also applies for the ternary operator: It may be split onto several lines, keeping the question mark and the colon at the front.

<?php

$a 
= $condition1 && $condition2
    
? $foo : $bar;

$b = $condition3 && $condition4
    
? $foo_man_this_is_too_long_what_should_i_do
    
: $bar;
?>


Вернуться к: Coding standard enhancements

© 2026 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты
Разработка компании ODWR