previousSplit long if statements onto several lines (Previous) (Next) Alignment of function parametersnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

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;
?>
previousSplit long if statements onto several lines (Previous) (Next) Alignment of function parametersnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.