1.2.523. Has Property Hook

The analyzed code makes use of property hooks. Property hooks are special methods, get and set, which are called when a property is read or written.

Property hooks were introduced in PHP 8.4.

<?php

class x {
     private string $property {
             get => $this->property;

             set { $this->property = mb_strtolower($property);}
     }
}

?>

1.2.523.1. Connex PHP features

1.2.523.1.1. Specs

Short name

Php/HasPropertyHook

Rulesets

All, Analyze, Appinfo, CompatibilityPHP84

Exakat since

2.6.8

PHP Version

With PHP 8.4 and more recent

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud