PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.inc

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.inc   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: 2 days ago
Size: 989 bytes
 

Contents

Class file image Download
<?php

switch ($foo) {
   
// Empty switch statement body
}

switch (
$foo) {
    case
'bar':
        break;
    default:
        break;
}


if (
$foo) {
   
// Just a comment
} elseif ($bar) {
   
// Yet another comment
} else {
   
}

if (
$foo) {
   
$foo = 'bar';
} else if (
$bar) {
   
$bar = 'foo';
}

for (
$i = 0; $i < 10; $i++) {
    for (
$j = 0; $j < 10; $j++) {
       
// Just a comment
   
}
}

foreach (
$foo as $bar) {}

foreach (
$foo as $bar) {
   
$bar *= 2;
}

do {
   
// Just a comment
    // Just another comment
} while ($foo);

do {
    while (
$bar) {
       
    }
} while (
true);

while (
$foo) { /* Comment in the same line */ }

while (
$foo) {
    try {
       
    } catch (
Exception $e) {
        echo
$e->getTraceAsString();
    }
}

try {
    throw
Exception('Error...');
} catch (
Exception $e) {}

try {
    throw
Exception('Error...');
} catch (
Exception $e) {
   
// TODO: Handle this exception later :-)
}

if (
true) {} elseif (false) {}

match($foo) {};