1--TEST--
2get_object_vars() fast/slow-path discrepancies
3--EXTENSIONS--
4json
5--FILE--
6<?php
7
8$obj = (object)[
9    "\0A\0b" => 42,
10    "\0*\0c" => 24,
11    12 => 6,
12];
13$obj->test = new class implements JsonSerializable {
14    public function jsonSerialize(): mixed {
15        var_dump(get_object_vars($GLOBALS['obj']));
16        return null;
17    }
18};
19
20var_dump(get_object_vars($obj));
21
22// Use json_encode to get a dump with apply_count > 0
23json_encode($obj);
24
25?>
26--EXPECTF--
27array(4) {
28  ["%0A%0b"]=>
29  int(42)
30  ["%0*%0c"]=>
31  int(24)
32  [12]=>
33  int(6)
34  ["test"]=>
35  object(JsonSerializable@anonymous)#2 (0) {
36  }
37}
38array(4) {
39  ["%0A%0b"]=>
40  int(42)
41  ["%0*%0c"]=>
42  int(24)
43  [12]=>
44  int(6)
45  ["test"]=>
46  object(JsonSerializable@anonymous)#2 (0) {
47  }
48}
49