Skip to content

Instantly share code, notes, and snippets.

@commana
Created October 31, 2009 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commana/223098 to your computer and use it in GitHub Desktop.
Save commana/223098 to your computer and use it in GitHub Desktop.
eStudy Conventions
<?php
class Example extends SuperExample implements I0, I1, I2 {
const MY_TRUE = 1;
private $a = 0;
public function foo($a, $b) {
for ($i = 0; $i < 10; $i++) {}
switch ($a) {
case 0:
$Other->doFoo();
break;
default:
$Other->doBaz();
}
}
private function bar($v) {
for ($i = 0; $i < 10; ++$i) {
$v->add($i);
}
}
private function strike() {
$a = 4;
foo();
bar($x, $y);
if (true) {
return 1;
} else if (true) {
return 3;
} else {
return 2;
}
try {
echo $b;
} catch (Exception $e) {
echo "Fehler.";
}
while ($a)
;
}
protected function calc(array $array) {
foreach ($array as $key => $value) {
MyClass::foo($key, $value);
}
$a = -4 + -9;
$b = $a++ / --$number;
$c += 4;
$value = true && false;
$s = (string) $object;
$a = $condition ? TRUE : FALSE;
list($a, $b) = array(1, 2, 3);
$array = array(1 => 2, 2 => 3);
$array[$i]->foo();
$array[] = 'first cell';
}
private function oneLiners() {
do {} while (true);
try {} catch (Exception $e) {}
for (;;) {}
}
}
// Kein PHP-Tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment