# PHP: Parse Error on Disjunctive Normal Form Types (PHP 8.2 feature)

**URL:** <https://community.sonarsource.com/t/php-parse-error-on-disjunctive-normal-form-types-php-8-2-feature/125515>\
**Category:** SonarQube Cloud\
**Tags:** php8, php\
**Created:** [September 20, 2024, 10:34am UTC](https://community.sonarsource.com/t/php-parse-error-on-disjunctive-normal-form-types-php-8-2-feature/125515 "2024-09-20T10:34:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stchrTIO](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/stchrtio/32/61407_2.png) [@stchrTIO](https://community.sonarsource.com/u/stchrTIO)\
**Post date:** [September 20, 2024, 10:34am UTC](https://community.sonarsource.com/t/php-parse-error-on-disjunctive-normal-form-types-php-8-2-feature/125515/1 "2024-09-20T10:34:41Z")

</div>

We are using SonarCloud with sonarsource/sonar-scanner-cli Docker Image for analyzing PHP files.  
When using typed properties with Disjunctive Normal Form (introduced in PHP 8.2, see [PHP: rfc:dnf\_types](https://wiki.php.net/rfc/dnf_types)), we get this error:

```auto
ERROR Unable to parse file [file:///path/ExampleClass.php] at line 4
ERROR Parse error at line 4 column 18:

```

[Online PHP editor | output for c3IEO](https://3v4l.org/c3IEO) gives an example and shows that this parse error is valid for PHP versions below 8.2, but totally valid for PHP 8.2 and greater.

Additional infos: [PHP: Type declarations - Manual](https://www.php.net/manual/en/language.types.declarations.php)

And as stated by [PHP Static Code Analysis & Laravel Clean Code Programming Language](https://www.sonarsource.com/knowledge/languages/php/), PHP versions from 8.0 to 8.3 should be fully supported.

---

<div class="post-metadata">

**Author:** ![Marcin\_Stachniuk](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marcin_stachniuk/32/37891_2.png) [@Marcin\_Stachniuk](https://community.sonarsource.com/u/Marcin_Stachniuk)\
**Post date:** [September 23, 2024, 2:28pm UTC](https://community.sonarsource.com/t/php-parse-error-on-disjunctive-normal-form-types-php-8-2-feature/125515/4 "2024-09-23T14:28:37Z")

</div>

Hi @stchrTIO

Thank you for the report, and welcome to the community!

I confirm the error. I created a ticket [[SONARPHP-1533] - Jira](https://sonarsource.atlassian.net/browse/SONARPHP-1533) to fix this issue.

Best  
Marcin Stachniuk
