bug39576.phpt 790 B

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