Skip to content

Commit 2ab1e4b

Browse files
authored
PHPC-2230: Drop support for PHP 7.2 and 7.3 (#1450)
* PHPC-2230: Drop support for PHP 7.2 and 7.3 * Remove compatibility code for PHP < 7.4 * Drop tests for legacy PHP serialization behaviour * Remove type match regexes in tests * Match object properties as strings * Fix var_export format in tests * Use wildcards when matching object properties * Remove unnecessary matching pattern in __set_state tests
1 parent b442f4c commit 2ab1e4b

File tree

133 files changed

+206
-2123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+206
-2123
lines changed

.evergreen/config.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,14 +1100,6 @@ axes:
11001100
display_name: "PHP 7.4"
11011101
variables:
11021102
PHP_VERSION: "7.4"
1103-
- id: "7.3"
1104-
display_name: "PHP 7.3"
1105-
variables:
1106-
PHP_VERSION: "7.3"
1107-
- id: "7.2"
1108-
display_name: "PHP 7.2"
1109-
variables:
1110-
PHP_VERSION: "7.2"
11111103

11121104
- id: php-edge-versions
11131105
display_name: PHP Version
@@ -1117,9 +1109,9 @@ axes:
11171109
variables:
11181110
PHP_VERSION: "8.2"
11191111
- id: "oldest-supported"
1120-
display_name: "PHP 7.2"
1112+
display_name: "PHP 7.4"
11211113
variables:
1122-
PHP_VERSION: "7.2"
1114+
PHP_VERSION: "7.4"
11231115

11241116
- id: os
11251117
display_name: OS
@@ -1231,7 +1223,7 @@ buildvariants:
12311223
# Exclude "latest-stable" PHP version for Debian 11 (see: test-mongodb-versions matrix)
12321224
- { "os": "debian11", "mongodb-edge-versions": "*", "php-versions": "8.2" }
12331225
# Exclude PHP versions older than 8.1 on RHEL 9 and Ubuntu 22.04 (OpenSSL 3 is only supported on PHP 8.1+)
1234-
- { "os": ["rhel90", "ubuntu2204-arm64", "ubuntu2204"], "mongodb-edge-versions": "*", "php-versions": ["7.2", "7.3", "7.4", "8.0"] }
1226+
- { "os": ["rhel90", "ubuntu2204-arm64", "ubuntu2204"], "mongodb-edge-versions": "*", "php-versions": ["7.4", "8.0"] }
12351227
tasks:
12361228
- name: "test-standalone-ssl"
12371229
- name: "test-replicaset-auth"

.github/workflows/tests.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,17 @@ jobs:
8181

8282
windows-tests:
8383
name: "Windows Tests"
84-
runs-on: ${{ matrix.os }}
84+
runs-on: windows-2022
8585
defaults:
8686
run:
8787
shell: cmd
8888

8989
strategy:
9090
fail-fast: true
9191
matrix:
92-
os: [ windows-2019, windows-2022 ]
93-
php: [ "7.2", "7.3", "7.4", "8.0", "8.1", "8.2" ]
92+
php: [ "7.4", "8.0", "8.1", "8.2" ]
9493
arch: [ x64, x86 ]
9594
ts: [ ts, nts ]
96-
exclude:
97-
- { os: windows-2019, php: "8.2" }
98-
- { os: windows-2019, php: "8.1" }
99-
- { os: windows-2019, php: "8.0" }
100-
- { os: windows-2019, php: "7.4" }
101-
- { os: windows-2019, php: "7.3" }
102-
- { os: windows-2022, php: "7.2" }
10395

10496
steps:
10597
- uses: actions/checkout@v3

.github/workflows/windows-release-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
# Note: keep this in sync with the Windows matrix in tests.yml
13-
php: [ "7.2", "7.3", "7.4", "8.0", "8.1", "8.2" ]
13+
php: [ "7.4", "8.0", "8.1", "8.2" ]
1414
arch: [ x64, x86 ]
1515
ts: [ ts, nts ]
1616
runs-on: ubuntu-latest

config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ if test "$PHP_MONGODB" != "no"; then
2727
fi
2828

2929
AC_MSG_RESULT($PHP_MONGODB_PHP_VERSION)
30-
if test "$PHP_MONGODB_PHP_VERSION_ID" -lt "70200"; then
31-
AC_MSG_ERROR([not supported. Need a PHP version >= 7.2.0 (found $PHP_MONGODB_PHP_VERSION)])
30+
if test "$PHP_MONGODB_PHP_VERSION_ID" -lt "70400"; then
31+
AC_MSG_ERROR([not supported. Need a PHP version >= 7.4.0 (found $PHP_MONGODB_PHP_VERSION)])
3232
fi
3333

3434
PHP_ARG_ENABLE([mongodb-developer-flags],

config.w32

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ ARG_WITH("mongodb-client-side-encryption", "MongoDB: Enable client-side encrypti
6666

6767
if (PHP_MONGODB != "no") {
6868
/* Note: ADD_EXTENSION_DEP() only reports the date and standard extensions as
69-
* installed in PHP 7.3.25+, 7.4.13+, and 8.0.0+). On other versions, assume
70-
* that they're always enabled. */
69+
* installed in PHP 7.4.13+ and 8.0.0+). On other versions, assume that
70+
* they're always enabled. */
7171
if (
7272
PHP_VERSION >= 8 ||
73-
(PHP_VERSION == 7 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 25) ||
7473
(PHP_VERSION == 7 && PHP_MINOR_VERSION == 4 && PHP_RELEASE_VERSION >= 13)
7574
) {
7675
ADD_EXTENSION_DEP("mongodb", "date", false);

src/BSON/Document.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static PHP_METHOD(MongoDB_BSON_Document, fromPHP)
153153
zval* data;
154154

155155
PHONGO_PARSE_PARAMETERS_START(1, 1)
156-
PHONGO_PARAM_ARRAY_OR_OBJECT(data)
156+
Z_PARAM_ARRAY_OR_OBJECT(data)
157157
PHONGO_PARSE_PARAMETERS_END();
158158

159159
object_init_ex(&zv, php_phongo_document_ce);

src/BSON/Int64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,7 @@ static zend_result php_phongo_int64_cast_object(phongo_compat_object_handler_typ
294294
return SUCCESS;
295295

296296
case IS_LONG:
297-
#if PHP_VERSION_ID >= 70300
298297
case _IS_NUMBER:
299-
#endif
300298
#if SIZEOF_ZEND_LONG == 4
301299
if (intern->integer > INT32_MAX || intern->integer < INT32_MIN) {
302300
zend_error(E_WARNING, "Truncating 64-bit integer value %" PRId64 " to 32 bits", intern->integer);

src/BSON/functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ PHP_FUNCTION(fromPHP)
2929
bson_t* bson;
3030

3131
PHONGO_PARSE_PARAMETERS_START(1, 1)
32-
PHONGO_PARAM_ARRAY_OR_OBJECT(data)
32+
Z_PARAM_ARRAY_OR_OBJECT(data)
3333
PHONGO_PARSE_PARAMETERS_END();
3434

3535
bson = bson_new();

src/MongoDB/BulkWrite.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static PHP_METHOD(MongoDB_Driver_BulkWrite, insert)
387387
intern = Z_BULKWRITE_OBJ_P(getThis());
388388

389389
PHONGO_PARSE_PARAMETERS_START(1, 1)
390-
PHONGO_PARAM_ARRAY_OR_OBJECT(zdocument)
390+
Z_PARAM_ARRAY_OR_OBJECT(zdocument)
391391
PHONGO_PARSE_PARAMETERS_END();
392392

393393
bson_flags |= PHONGO_BSON_RETURN_ID;
@@ -429,8 +429,8 @@ static PHP_METHOD(MongoDB_Driver_BulkWrite, update)
429429
intern = Z_BULKWRITE_OBJ_P(getThis());
430430

431431
PHONGO_PARSE_PARAMETERS_START(2, 3)
432-
PHONGO_PARAM_ARRAY_OR_OBJECT(zquery)
433-
PHONGO_PARAM_ARRAY_OR_OBJECT(zupdate)
432+
Z_PARAM_ARRAY_OR_OBJECT(zquery)
433+
Z_PARAM_ARRAY_OR_OBJECT(zupdate)
434434
Z_PARAM_OPTIONAL
435435
Z_PARAM_ARRAY_OR_NULL(zoptions)
436436
PHONGO_PARSE_PARAMETERS_END();
@@ -494,7 +494,7 @@ static PHP_METHOD(MongoDB_Driver_BulkWrite, delete)
494494
intern = Z_BULKWRITE_OBJ_P(getThis());
495495

496496
PHONGO_PARSE_PARAMETERS_START(1, 2)
497-
PHONGO_PARAM_ARRAY_OR_OBJECT(zquery)
497+
Z_PARAM_ARRAY_OR_OBJECT(zquery)
498498
Z_PARAM_OPTIONAL
499499
Z_PARAM_ARRAY_OR_NULL(zoptions)
500500
PHONGO_PARSE_PARAMETERS_END();

src/MongoDB/ClientEncryption.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static PHP_METHOD(MongoDB_Driver_ClientEncryption, rewrapManyDataKey)
408408
const bson_t* bulk_write_result;
409409

410410
PHONGO_PARSE_PARAMETERS_START(1, 2)
411-
PHONGO_PARAM_ARRAY_OR_OBJECT(zfilter)
411+
Z_PARAM_ARRAY_OR_OBJECT(zfilter)
412412
Z_PARAM_OPTIONAL
413413
Z_PARAM_ARRAY_OR_NULL(options)
414414
PHONGO_PARSE_PARAMETERS_END();

0 commit comments

Comments
 (0)