Lutra/crates/syntax/tests/fixtures/scripts_and_anonymous.php
danny a5236acd7e M2.1: tree-sitter PHP in crates/syntax
Parser (parse, incremental reparse from lutra_text edits), outline with
UTF-16 ranges and short signatures, folding ranges, 8 MiB parse cap.
Snapshot tests for five PHP 8.3 fixtures, proptests (random bytes,
reparse equals fresh parse, undo round trip), ignored release timing
test. Docs: architecture Syntax section, parity evidence, G4 note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:06:21 +02:00

39 lines
667 B
PHP

<html>
<body>
<?php
if (!function_exists('greet')) {
function greet(string $name = 'world'): string
{
return "Hello, {$name}!";
}
}
$handler = function (int $code) {
function not_listed_inside_closure() {}
return $code;
};
$double = fn(int $x): int => $x * 2;
return new class ('db') extends Migration implements Countable {
public function __construct(private string $connection)
{
}
public function up(): void
{
$inner = new class {
public function hidden(): void {}
};
}
public function count(): int
{
return 0;
}
};
?>
<p><?= greet() ?></p>
</body>
</html>