bug80215.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --TEST--
  2. Bug #80215 (imap_mail_compose() may modify by-val parameters)
  3. --EXTENSIONS--
  4. imap
  5. --FILE--
  6. <?php
  7. $envelope = [
  8. "from" => 1,
  9. "to" => 2,
  10. "custom_headers" => [3],
  11. ];
  12. $body = [[
  13. "contents.data" => 4,
  14. "type.parameters" => ['foo' => 5],
  15. "disposition" => ['bar' => 6],
  16. ], [
  17. "contents.data" => 7,
  18. "type.parameters" => ['foo' => 8],
  19. "disposition" => ['bar' => 9],
  20. ]];
  21. imap_mail_compose($envelope, $body);
  22. var_dump($envelope, $body);
  23. ?>
  24. --EXPECT--
  25. array(3) {
  26. ["from"]=>
  27. int(1)
  28. ["to"]=>
  29. int(2)
  30. ["custom_headers"]=>
  31. array(1) {
  32. [0]=>
  33. int(3)
  34. }
  35. }
  36. array(2) {
  37. [0]=>
  38. array(3) {
  39. ["contents.data"]=>
  40. int(4)
  41. ["type.parameters"]=>
  42. array(1) {
  43. ["foo"]=>
  44. int(5)
  45. }
  46. ["disposition"]=>
  47. array(1) {
  48. ["bar"]=>
  49. int(6)
  50. }
  51. }
  52. [1]=>
  53. array(3) {
  54. ["contents.data"]=>
  55. int(7)
  56. ["type.parameters"]=>
  57. array(1) {
  58. ["foo"]=>
  59. int(8)
  60. }
  61. ["disposition"]=>
  62. array(1) {
  63. ["bar"]=>
  64. int(9)
  65. }
  66. }
  67. }