dl-check-enabled.phpt 505 B

12345678910111213141516171819202122
  1. --TEST--
  2. dl() returns false when disabled via INI settings
  3. --CREDITS--
  4. Tom Van Herreweghe <tom@theanalogguy.be>
  5. User Group: PHP-WVL & PHPGent #PHPTestFest
  6. --SKIPIF--
  7. <?php
  8. $enabled_sapi = array('cgi-fcgi', 'cli', 'embed', 'fpm');
  9. if (!in_array(php_sapi_name(), $enabled_sapi)) {
  10. die('skip dl() is not enabled for ' . php_sapi_name());
  11. }
  12. ?>
  13. --INI--
  14. enable_dl=0
  15. --FILE--
  16. <?php
  17. var_dump(dl('foo'));
  18. ?>
  19. --EXPECTF--
  20. Warning: dl(): Dynamically loaded extensions aren't enabled in %s on line %d
  21. bool(false)