Skip to content

Conversation

@krzysztofrewak
Copy link
Member

Not all PHP 8.4 features are working. For example, this is a sample code from PHP website (https://www.php.net/releases/8.4/en.php) and it cracks Fixer:

class Locale
{
    public string $languageCode;

    public string $countryCode
    {
        set (string $countryCode) {
            $this->countryCode = strtoupper($countryCode);
        }
    }

    public string $combinedCode
    {
        get => \sprintf("%s_%s", $this->languageCode, $this->countryCode);
        set (string $value) {
            [$this->languageCode, $this->countryCode] = explode('_', $value, 2);
        }
    }

    public function __construct(string $languageCode, string $countryCode)
    {
        $this->languageCode = $languageCode;
        $this->countryCode = $countryCode;
    }
}

$brazilianPortuguese = new Locale('pt', 'br');
var_dump($brazilianPortuguese->countryCode); // BR
var_dump($brazilianPortuguese->combinedCode); // pt_BR

So for now I used simpler code to be sure that some of PHP 8.4 features works:

class PhpVersion
{
    public private(set) string $version = '8.4';

    public function increment(): void
    {
        [$major, $minor] = explode('.', $this->version);
        $minor++;
        $this->version = "{$major}.{$minor}";
    }
}

I also removed PHP 8.2 compatibility.

kamilpiech97
kamilpiech97 previously approved these changes Jul 7, 2025
kamilpiech97
kamilpiech97 previously approved these changes Jul 7, 2025
@krzysztofrewak krzysztofrewak merged commit 81fb8ca into main Jul 8, 2025
3 checks passed
@krzysztofrewak krzysztofrewak deleted the php84 branch July 8, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants