previousAlignment of assignments (Previous) (Next) Recommendationsnext

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

Array formatting

Assignments in arrays may be aligned. When splitting array definitions onto several lines, the last value may also have a trailing comma. This is valid PHP syntax and helps to keep code diffs minimal:

<?php

$some_array 
= array(
    
'foo'  => 'bar',
    
'spam' => 'ham',
);
?>
previousAlignment of assignments (Previous) (Next) Recommendationsnext

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.