
PHP Attributes
PHP 8 attributes SAMPLE for PHP tooling.
- File
- PHP · PHP
- Use case
- Syntax highlightingCode parsing+1
Find files, editable templates and browser test targets by what you need to make or test. The directory below is cut by format; the two collections under it cut the same library by subject and by workflow.
Page 4 of 6; 24 results per page.

PHP 8 attributes SAMPLE for PHP tooling.

Intentionally lint-bait SAMPLE php snippet (error-suppression-invalid) for rule-engine tests.

The classic hello-world in PHP (an opening tag and echo) for testing highlighters, the PHP interpreter, and parsers.

A realistic modern-PHP snippet with strict types, a namespace, a backed enum, a final class with constructor-promoted readonly properties, and array_reduce with an arrow function, for testing highlighters, PHPStan, and parsers.

Tiny asyncio gather stub for async Python tooling.

Python dataclass SAMPLE for highlighter and type-checker smoke tests.

Intentionally lint-bait SAMPLE python snippet (bare-except-invalid) for rule-engine tests.

Intentionally lint-bait SAMPLE python snippet (unused-import-invalid) for rule-engine tests.

A realistic Python snippet exercising type hints, an lru_cache-memoised recursive function, a generator, and a frozen dataclass, for testing syntax highlighters, linters (ruff/flake8), and formatters (black).

The classic hello-world in idiomatic Python 3, with a shebang, a module docstring, and the standard main guard: the minimal correct program for testing highlighters and interpreters.

Intentionally invalid Python indentation for linter / parser error-path tests. Labelled intentionally invalid in title and description.

Intentionally invalid Python match (missing colon) for linters.

R data.frame construction: realistic snippet for R parsers.

Minimal R hello-world for RStudio / language-server fixtures.

R native pipe (|>) snippet for modern R tooling.

Intentionally invalid R (unclosed call) for parser tests.

Intentionally lint-bait SAMPLE ruby snippet (rescue-all-invalid) for rule-engine tests.

Ruby nested module SAMPLE for parser tests.

The classic hello-world in Ruby (a single puts) for testing highlighters, the Ruby interpreter, and parsers.

A realistic Ruby snippet: a Stack class that mixes in Enumerable, yields blocks, raises a custom error class, and uses string interpolation and symbol-to-proc, for testing highlighters, RuboCop, and parsers.

Intentionally lint-bait SAMPLE rust snippet (unwrap-invalid) for rule-engine tests.

Rust Result map chain: realistic error-handling snippet.

The classic hello-world in Rust: fn main and the println! macro, for testing highlighters, rustc, and parsers.

Intentionally invalid Rust for rustc error-path fixtures.