xref: /PHP-5.6/ext/standard/tests/array/bug39576.phpt (revision df1a1c84)
1--TEST--
2Bug #39576 (array_walk() doesn't separate userdata zval)
3--FILE--
4<?php
5
6class Test {
7
8	public $_table = '';
9	public $_columns = array ();
10	public $_primary = array ();
11
12}
13
14$test = new Test ();
15$test->name = 'test';
16$test->_columns['name'] = new stdClass;
17
18function test ($value, $column, &$columns) {}
19
20array_walk (
21	get_object_vars ($test),
22	'test',
23	$test->_columns
24);
25
26var_dump($test);
27
28array_intersect_key (
29	get_object_vars ($test),
30	$test->_primary
31);
32
33echo "Done\n";
34?>
35--EXPECTF--
36Strict Standards: Only variables should be passed by reference in %s on line %d
37object(Test)#%d (4) {
38  ["_table"]=>
39  string(0) ""
40  ["_columns"]=>
41  array(1) {
42    ["name"]=>
43    object(stdClass)#%d (0) {
44    }
45  }
46  ["_primary"]=>
47  array(0) {
48  }
49  ["name"]=>
50  string(4) "test"
51}
52Done
53