Skip to content

Commit fe0763c

Browse files
committed
Make $use_less_memory a boolean parameter
1 parent 15896d0 commit fe0763c

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

ext/bz2/bz2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,15 @@ PHP_FUNCTION(bzdecompress)
496496
zend_string *dest;
497497
size_t source_len;
498498
int error;
499-
zend_long small = 0;
499+
zend_bool small = 0;
500500
#ifdef PHP_WIN32
501501
unsigned __int64 size = 0;
502502
#else
503503
unsigned long long size = 0;
504504
#endif
505505
bz_stream bzs;
506506

507-
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &small)) {
507+
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &source, &source_len, &small)) {
508508
RETURN_THROWS();
509509
}
510510

ext/bz2/bz2.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ function bzerror($bz): array {}
4040

4141
function bzcompress(string $data, int $block_size = 4, int $work_factor = 0): string|int {}
4242

43-
function bzdecompress(string $data, int $use_less_memory = 0): string|int|false {}
43+
function bzdecompress(string $data, bool $use_less_memory = false): string|int|false {}

ext/bz2/bz2_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 305cbe9825a0d62ad966c09a50c53dd6cc49011e */
2+
* Stub hash: 6953f91be31777e4d4e3652f75eec6d968cf636a */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_bzopen, 0, 0, 2)
55
ZEND_ARG_INFO(0, file)
@@ -43,7 +43,7 @@ ZEND_END_ARG_INFO()
4343

4444
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bzdecompress, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
4545
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
46-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_less_memory, IS_LONG, 0, "0")
46+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_less_memory, _IS_BOOL, 0, "false")
4747
ZEND_END_ARG_INFO()
4848

4949

ext/bz2/tests/005.phpt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ var_dump(bzdecompress(1,1));
2626
var_dump(bzdecompress($data3));
2727
var_dump(bzdecompress($data3,1));
2828

29-
var_dump(bzdecompress($data, -1));
3029
var_dump(bzdecompress($data, 0));
31-
var_dump(bzdecompress($data, 1000));
30+
var_dump(bzdecompress($data, 1));
3231
var_dump(bzdecompress($data));
3332
var_dump(bzdecompress($data2));
3433

@@ -43,12 +42,14 @@ int(-2)
4342
int(-5)
4443
int(-5)
4544
int(-5)
46-
bool(false)
4745
string(110) "Life it seems, will fade away
4846
Drifting further everyday
4947
Getting lost within myself
5048
Nothing matters no one else"
51-
bool(false)
49+
string(110) "Life it seems, will fade away
50+
Drifting further everyday
51+
Getting lost within myself
52+
Nothing matters no one else"
5253
string(110) "Life it seems, will fade away
5354
Drifting further everyday
5455
Getting lost within myself

0 commit comments

Comments
 (0)