PHPackages                             sspat/reserved-words - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. sspat/reserved-words

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

sspat/reserved-words
====================

Validates strings against reserved words of a specific php version

3.0.2(1y ago)027.1k↓34.5%12MITPHPPHP ^7.3|^8.0CI failing

Since Jan 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sspat/reserved-words)[ Packagist](https://packagist.org/packages/sspat/reserved-words)[ RSS](/packages/sspat-reserved-words/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (8)Versions (6)Used By (2)

Php Reserved Words checker
==========================

[](#php-reserved-words-checker)

[![Latest Version](https://camo.githubusercontent.com/0e6cff3ff2b414d97de6b3669687bb95ea9d40ddd80b1ac6c59e2b9472f167a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73737061742f72657365727665642d776f726473)](https://github.com/sspat/reserved-words/releases)[![Build](https://camo.githubusercontent.com/56061e09a75c99e4e96a830ad801c6c6a7ed767c80a330020190d417e6b16400/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73737061742f72657365727665642d776f7264732f6d6173746572)](https://travis-ci.org/sspat/reserved-words)[![Mutation testing badge](https://camo.githubusercontent.com/fd623701937404f99bcedc7fa9b42d0f8a90b0845c6240f9bccc35afb3afc7fc/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246737370617425324672657365727665642d776f7264732532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/sspat/reserved-words/master)[![Test Coverage](https://camo.githubusercontent.com/3e61dee600d03a9bf5535d5862318a076f72df295afeaaa2b70729fba3d6f1cd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73737061742f72657365727665642d776f7264732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/sspat/reserved-words?branch=master)[![Type Coverage](https://camo.githubusercontent.com/af0c8a4173b86eb8f88c6dca1ec7e6e8c88c27c4e2b1ceddbef857fa2e95c4d4/68747470733a2f2f73686570686572642e6465762f6769746875622f73737061742f72657365727665642d776f7264732f636f7665726167652e737667)](https://shepherd.dev/github/sspat/reserved-words)[![License](https://camo.githubusercontent.com/ba7d0bb95603f56aceeb2758db347d6ed627ee90c81ced5cce7ef88790073a01/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73737061742f72657365727665642d776f726473)](https://github.com/sspat/reserved-words/blob/master/LICENSE)

About
-----

[](#about)

This package allows checking strings for being a PHP reserved word and also the possibility of using the string as a PHP namespace/class/interface/trait, function, method or constant name.

By default checks are performed for your current runtime PHP version, but you can specify any version to check against.

This can come in handy during code generation for example, when PHP code is generated based on some user input.

Reserved words in the PHP documentation:

- [List of Keywords](https://www.php.net/manual/en/reserved.keywords.php)
- [List of other reserved words](https://www.php.net/manual/en/reserved.other-reserved-words.php)

Installation
------------

[](#installation)

```
composer require sspat/reserved-words

```

Usage
-----

[](#usage)

```
