#126 · Programming Language Tools Developer Tool

PHP Validator

Validate PHP source against configurable version, typing, naming, structure, and project-style rules. Unlike the quick checker, this tool focuses on rule compliance.

Developer Input

Local browser processing
Ad space

How to use this developer tool

  1. Paste PHP code.
  2. Select a validation profile.
  3. Enter a target PHP version.
  4. Enable strict typing and naming rules.
  5. Review failed rules.

What this developer tool does

It applies a selected validation profile, counts passed and failed rules, and reports required fixes separately from optional improvements.

Structural checks → profile requirements → version compatibility → naming rules → compliance score.

Passing this validator does not guarantee runtime success. Use php -l, static analyzers, tests, and your project coding standard for final verification.

Example

Input: an untyped snake_case class.

Strict output: missing strict_types, namespace, parameter types, return types, and PascalCase naming.

Tips for better output

  • Use Modern PHP for new projects.
  • Use Custom when migrating legacy code gradually.
  • Do not enable rules your runtime version cannot support.

FAQ

How do I validate PHP code against PHP 8.2 rules?

Select a profile, enter 8.2, and run validation to check selected modern syntax and project rules.

How can I check whether PHP code uses strict types?

Enable Require strict_types. The validator checks for declare(strict_types=1).

How do I validate PHP class and method naming conventions?

Enable naming checks to flag class names that are not PascalCase and methods that are not camelCase.

How can I detect PHP version compatibility issues?

Set the target version. The validator compares known feature patterns such as enums and readonly properties with that target.

What is the difference between a PHP checker and a PHP validator?

The checker finds likely mistakes quickly; the validator measures compliance against an explicit ruleset.

Validation rules

ModulePurpose
Strict typesdeclare(strict_types=1)
TypingProperties, parameters, returns
NamingPascalCase and camelCase
CompatibilityTarget PHP version

Browse more developer tools

Calldeveloper category hub