Skip to content

Commit 3f93f15

Browse files
Tom Van Herreweghepetk
authored andcommitted
Tests the 'Dynamically loaded extensions are not enabled' warning for dl()
Signed-off-by: Tom Van Herreweghe <[email protected]>
1 parent 27b366c commit 3f93f15

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
dl() returns false when disabled via INI settings
3+
+--CREDITS--
4+
Tom Van Herreweghe <[email protected]>
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+
21+
Warning: dl(): Dynamically loaded extensions aren't enabled in %s on line %d
22+
bool(false)

0 commit comments

Comments
 (0)