dl-002.phpt 730 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. dl(): Extensions compiled against zend_register_ini_entries() are supported
  3. --ENV--
  4. PHP_DL_TEST_USE_OLD_REGISTER_INI_ENTRIES=1
  5. --SKIPIF--
  6. <?php include dirname(__DIR__, 3) . "/dl_test/tests/skip.inc"; ?>
  7. --FILE--
  8. <?php
  9. if (extension_loaded('dl_test')) {
  10. exit('Error: dl_test is already loaded');
  11. }
  12. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  13. $loaded = dl('php_dl_test.dll');
  14. } else {
  15. $loaded = dl('dl_test.so');
  16. }
  17. var_dump($loaded);
  18. dl_test_test1();
  19. var_dump(dl_test_test2("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) "0"
  28. string(5) "hello"
  29. OK