bug46711.phpt 496 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #46711 (lost memory when foreach is used for values passed to curl_setopt())
  3. --EXTENSIONS--
  4. curl
  5. --FILE--
  6. <?php
  7. $ch = curl_init();
  8. $opt = array(
  9. CURLOPT_AUTOREFERER => TRUE,
  10. CURLOPT_BINARYTRANSFER => TRUE
  11. );
  12. curl_setopt( $ch, CURLOPT_AUTOREFERER , TRUE );
  13. foreach( $opt as $option => $value ) {
  14. curl_setopt( $ch, $option, $value );
  15. }
  16. var_dump($opt); // with this bug, $opt[58] becomes NULL
  17. ?>
  18. --EXPECT--
  19. array(2) {
  20. [58]=>
  21. bool(true)
  22. [19914]=>
  23. bool(true)
  24. }