xref: /PHP-7.2/Zend/tests/bug69996.phpt (revision f930d6ea)
1--TEST--
2Bug #69996 (Changing the property of a cloned object affects the original)
3--FILE--
4<?php
5
6function method($cache) {
7	  $prepared = clone $cache;
8	  var_dump($prepared->data);
9	  $prepared->data = "bad";
10	  return $prepared;
11}
12
13$cache = new stdClass();
14$cache->data = "good";
15
16for ($i = 0; $i < 5; ++$i) {
17	   method($cache);
18}
19?>
20--EXPECT--
21string(4) "good"
22string(4) "good"
23string(4) "good"
24string(4) "good"
25string(4) "good"
26