[php-src] Issue #8003: Undocumented change: order of returned parameters in get_object_vars() differs from previous versions
| From: | beephotography | Date: | Wed, 26 Jan 2022 09:44:27 +0000 |
| Subject: | [php-src] Issue #8003: Undocumented change: order of returned parameters in get_object_vars() differs from previous versions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239291@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8003
Author: beephotography
### Description
The following code:
```php
<?php
class TestA extends TestB
{
protected $foo;
public function test()
{
return get_object_vars($this);
}
}
class TestB
{
protected $bar;
}
$foo = new TestA();
print_r($foo->test());
```
Resulted in this output:
```
array(2) {
["bar"]=>
NULL
["foo"]=>
NULL
}
```
But in PHP < 8.1.0 I got this output instead:
```
array(2) {
["foo"]=>
NULL
["bar"]=>
NULL
}
```
### PHP Version
PHP >= 8.1.0
### Operating System
_No response_