php-parser/example.php

43 lines
561 B
PHP
Raw Normal View History

2017-12-01 16:04:31 +00:00
<?php
2017-12-03 07:17:05 +00:00
namespace z7zmey\Example {
use \Exception;
use z7zmey\Foo\{Bar, function Baz};
abstract class Foo extends Bar implements Buz, Buzz {
use \z7zmey\_Trait;
public const CC = 0;
public function &test(bool $a, string $b = null): ?void {
}
2017-12-01 16:04:31 +00:00
}
2017-12-01 16:40:00 +00:00
}
2017-12-03 07:17:05 +00:00
namespace z7zmey\Example2;
2017-12-01 16:40:00 +00:00
if ($a === true) {
} elseif ($a === false) {
} elseif ($a === null) {
} else {
}
2017-12-03 07:17:05 +00:00
$a = "string
with $var
";
2017-12-03 21:29:17 +00:00
$a = "string
with out \$var";
2017-12-03 07:17:05 +00:00
$a = <<<test
2017-12-03 21:29:17 +00:00
string $var
2017-12-03 07:17:05 +00:00
test;
2017-12-03 21:29:17 +00:00
`test
$var
`;
2017-12-01 16:40:00 +00:00
?>
2017-12-03 18:49:18 +00:00
<?= $b = 22; $b ?>