xref: /PHP-7.4/Zend/tests/bug33171.phpt (revision 782352c5)
1--TEST--
2Bug #33171 (foreach enumerates private fields declared in base classes)
3--FILE--
4<?php
5class A
6{
7	private $c = "A's c";
8}
9
10class B extends A
11{
12	private $c = "B's c";
13
14	public function go()
15	{
16		foreach ($this as $key => $val)
17		{
18			echo "$key => $val\n";
19		}
20	}
21};
22
23$x = new B;
24$x->go();
25?>
26--EXPECT--
27c => B's c
28