PHP Classes
elePHPant
Icontem

File: phpcf-src/test/expected/short-array.php

Recommend this page to a friend!
  Classes of Alex Krash  >  PHP Code formatter  >  phpcf-src/test/expected/short-array.php  >  Download  
File: phpcf-src/test/expected/short-array.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP Code formatter
Reformat PHP code according to standard options
Author: By
Last change:
Date: 4 years ago
Size: 414 bytes
 

Contents

Class file image Download
<?php

// simple
$a = [];

// next line
$b = [];

// no spaces
$c = [1, 2, 3];

// extra spaces
$d = [1, 2, 3];

// dereferenced call
$e = [1, 2, 3][2];

// passed as param in function
$f = functionCall([1, 2, 3], [4]);

// simply somewhere
[1, 2, 3345];

// nested
[[1, 2, 3], [4, 5, 6]];

if (
true) {
    [
123, 456];
}
[
345];

array(
'a', [234, 345345, 8837673, 789], 'b');

array(
'a', [func() ? ['b'] : ['c']]);