Add php highlighting test file
This commit is contained in:
parent
be415d28b8
commit
f55a603031
59
test.php
Normal file
59
test.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
interface Ifoo {}
|
||||
|
||||
abstract class Foo implements Ifoo {
|
||||
abstract public function bar(int $a, float $b, array $c, callable $d): string;
|
||||
|
||||
protected function doNothing(): void {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Docblock comment
|
||||
*/
|
||||
class FooBar extends Foo implements Ifoo {
|
||||
public function bar(int $a, float $b, array $c, callable $d): string
|
||||
{
|
||||
$cstr = print_r($c, TRUE);
|
||||
$d();
|
||||
|
||||
return "{$a}, ${b}, " . $cstr;
|
||||
}
|
||||
|
||||
private function operations(int $a, int $b): int
|
||||
{
|
||||
$this->doNothing();
|
||||
|
||||
$c = $a + $b;
|
||||
$a = $c - $b;
|
||||
|
||||
$c = $a * $b;
|
||||
$b = (int) ($c / $a);
|
||||
|
||||
return $c;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Multi-line comment
|
||||
*/
|
||||
$foobar = new FooBar();
|
||||
|
||||
$x = 3;
|
||||
|
||||
// Heredoc
|
||||
$sql = <<<SQL
|
||||
SELECT * FROM "foo" WHERE "bar"='baz' AND id={$x};
|
||||
SQL;
|
||||
|
||||
// Nowdoc
|
||||
$template = <<<'TEMPLATE'
|
||||
<foo>{x}</foo>
|
||||
TEMPLATE;
|
||||
|
||||
?>
|
||||
<html lang="en">
|
||||
<body>
|
||||
<h1><?= $_SERVER['HTTP_HOST'] ?></h1>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user