Skip to content

get_class_vars contains a break change #13835

Closed
@eerison

Description

@eerison

Description

Hello guys, on php 8.1 + contain a break change, it should be the same behaviour for all php 8.x version, shouldn't it?

The following code:
https://3v4l.org/KRkS9#v

<?php
declare(strict_types=1);

class ExampleClass {
    public static bool $_strict = true;
}

ExampleClass::$_strict = false;

$example =  get_class_vars(ExampleClass::class);
var_dump($example);

Resulted in this output:

array(1) {
  ["_strict"]=>
  bool(true)
}

But I expected this output instead:

array(1) {
  ["_strict"]=>
  bool(false)
}

PHP Version

PHP 8.1+

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions