Skip to content

Update ext/bz2 parameter names #6280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions ext/bz2/bz2.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,15 @@ PHP_FUNCTION(bzdecompress)
zend_string *dest;
size_t source_len;
int error;
zend_long small = 0;
zend_bool small = 0;
#ifdef PHP_WIN32
unsigned __int64 size = 0;
#else
unsigned long long size = 0;
#endif
bz_stream bzs;

if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &small)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &source, &source_len, &small)) {
RETURN_THROWS();
}

Expand Down
4 changes: 2 additions & 2 deletions ext/bz2/bz2.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ function bzerrstr($bz): string {}
/** @param resource $bz */
function bzerror($bz): array {}

function bzcompress(string $source, int $blocksize = 4, int $workfactor = 0): string|int {}
function bzcompress(string $data, int $block_size = 4, int $work_factor = 0): string|int {}

function bzdecompress(string $source, int $small = 0): string|int|false {}
function bzdecompress(string $data, bool $use_less_memory = false): string|int|false {}
12 changes: 6 additions & 6 deletions ext/bz2/bz2_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 8eefa180e67776e8e0ba1b27fbf9b32c5b71725c */
* Stub hash: 6953f91be31777e4d4e3652f75eec6d968cf636a */

ZEND_BEGIN_ARG_INFO_EX(arginfo_bzopen, 0, 0, 2)
ZEND_ARG_INFO(0, file)
Expand Down Expand Up @@ -36,14 +36,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bzerror, 0, 1, IS_ARRAY, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bzcompress, 0, 1, MAY_BE_STRING|MAY_BE_LONG)
ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, blocksize, IS_LONG, 0, "4")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, workfactor, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, block_size, IS_LONG, 0, "4")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, work_factor, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bzdecompress, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, small, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_less_memory, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()


Expand Down
9 changes: 5 additions & 4 deletions ext/bz2/tests/005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ var_dump(bzdecompress(1,1));
var_dump(bzdecompress($data3));
var_dump(bzdecompress($data3,1));

var_dump(bzdecompress($data, -1));
var_dump(bzdecompress($data, 0));
var_dump(bzdecompress($data, 1000));
var_dump(bzdecompress($data, 1));
var_dump(bzdecompress($data));
var_dump(bzdecompress($data2));

Expand All @@ -43,12 +42,14 @@ int(-2)
int(-5)
int(-5)
int(-5)
bool(false)
string(110) "Life it seems, will fade away
Drifting further everyday
Getting lost within myself
Nothing matters no one else"
bool(false)
string(110) "Life it seems, will fade away
Drifting further everyday
Getting lost within myself
Nothing matters no one else"
string(110) "Life it seems, will fade away
Drifting further everyday
Getting lost within myself
Expand Down