Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -3271,7 +3271,7 @@ ZEND_API void zend_post_deactivate_modules(void) /* {{{ */
/* return the next free module number */
ZEND_API int zend_next_free_module(void) /* {{{ */
{
return zend_hash_num_elements(&module_registry) + 1;
return zend_hash_num_elements(&module_registry);
}
/* }}} */

Expand Down
8 changes: 7 additions & 1 deletion Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ zend_module_entry zend_builtin_module = { /* {{{ */

zend_result zend_startup_builtin_functions(void) /* {{{ */
{
return (EG(current_module) = zend_register_module_ex(&zend_builtin_module, MODULE_PERSISTENT)) == NULL ? FAILURE : SUCCESS;
zend_module_entry *module;
EG(current_module) = module = zend_register_module_ex(&zend_builtin_module, MODULE_PERSISTENT);
if (UNEXPECTED(module == NULL)) {
return FAILURE;
}
ZEND_ASSERT(module->module_number == 0);
return SUCCESS;
}
/* }}} */

Expand Down
19 changes: 19 additions & 0 deletions sapi/cli/tests/025.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
CLI php -i extension_dir
--SKIPIF--
<?php
include "skipif.inc";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die ("skip not for Windows");
}
?>
--FILE--
<?php

$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
$output = `$php -n -i`;
var_dump(str_contains($output, "extension_dir => "));

?>
--EXPECT--
bool(true)