dl-003.phpt 712 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. dl(): Loaded extensions support ini_set()
  3. --SKIPIF--
  4. <?php include dirname(__DIR__, 3) . "/dl_test/tests/skip.inc"; ?>
  5. --FILE--
  6. <?php
  7. if (extension_loaded('dl_test')) {
  8. exit('Error: dl_test is already loaded');
  9. }
  10. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  11. $loaded = dl('php_dl_test.dll');
  12. } else {
  13. $loaded = dl('dl_test.so');
  14. }
  15. var_dump($loaded);
  16. dl_test_test1();
  17. var_dump(dl_test_test2("World!"));
  18. ini_set("dl_test.long", "1");
  19. ini_set("dl_test.string", "world");
  20. var_dump(ini_get("dl_test.long"));
  21. var_dump(ini_get("dl_test.string"));
  22. echo "OK\n";
  23. --EXPECT--
  24. bool(true)
  25. The extension dl_test is loaded and working!
  26. string(12) "Hello World!"
  27. string(1) "1"
  28. string(5) "world"
  29. OK