<?php
namespace My\Namespace;
use UseThisClass;
use AlsoUseThis, AndUseThis;
use My\Favorite\UseMePlease;
use Other\Namespace\UseMe, Other\Namespace\NoUseMe;
interface Kissable extends Countable {
function kiss(array $foo = null);
}
abstract class HenryKissable extends ExtendedClass implements ImplementedInterface1, ImplementedInterface2, ImplementedInterface3 {
const KISS = 'kiss';
private $myPrivateVar;
public $publicVar;
#Perl-style comments are stupid
public function __construct($foo, Iterator $bar = null, array $kiss = array()) {
parent::__construct();
$this->myPrivateVar = $foo;
$this->publicVar = $bar ?: new self();
foreach ($kiss as $key => $value) {
//unset stuff
unset($this[$key]);
$this[$key] = is_int($value) ? (int)$value : (string)$value;
}
}
protected final function invokeStatic() {
StaticClass::invoke("this is a \"string\"");
static::doSomething();
switch (KISS) {
case 5:
case 0x1a:
if (KISS === 'foo') {
return null;
} elseif (KISS === 'bar') {
return false;
} else {
return true;
}
case 1e3:
break;
default:
throw new OutOfBoundsException();
}
}
public abstract function(TypeHinted $var);
/**
* This does something
*/
private static function doSomething() {
$heredoc = "this one is my \"favorite\"";
$heredoc .= <<<LOL
oh 'look'
a heredoc!
LOL;
$nowdoc = <<<'LULZ'
oh look
a nowdoc!
LULZ;
}
}
?>
<?
//short tags
?>
<?= 'lol' ?>