Skip to content

Commit 4ade6c3

Browse files
committed
fixups to enum support
* closes #173 * fixes #171
1 parent 93fe730 commit 4ade6c3

File tree

5 files changed

+70
-24
lines changed

5 files changed

+70
-24
lines changed

.github/workflows/ci.yml

+40-12
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,38 @@ jobs:
232232
run: |
233233
make -f scripts/ci/Makefile test
234234
235-
cur-none-0:
236-
name: php-8.2-nodebug-nozts
235+
cur-matrix-2:
236+
name: php-8.2-debug-zts
237237
env:
238238
PHP: "8.2"
239+
enable_debug: "yes"
240+
enable_zts: "yes"
241+
enable_session: "yes"
242+
runs-on: ubuntu-20.04
243+
steps:
244+
- uses: actions/checkout@v2
245+
with:
246+
submodules: true
247+
- name: Install
248+
run: |
249+
sudo apt-get install -y \
250+
php-cli \
251+
php-pear \
252+
re2c
253+
- name: Prepare
254+
run: |
255+
make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
256+
- name: Build
257+
run: |
258+
make -f scripts/ci/Makefile ext PECL=msgpack
259+
- name: Test
260+
run: |
261+
make -f scripts/ci/Makefile test
262+
263+
cur-none-0:
264+
name: php-8.3-nodebug-nozts
265+
env:
266+
PHP: "8.3"
239267
enable_session: "no"
240268
runs-on: ubuntu-20.04
241269
steps:
@@ -259,9 +287,9 @@ jobs:
259287
make -f scripts/ci/Makefile test
260288
261289
cur-dbg-zts-0:
262-
name: php-8.2-debug-zts
290+
name: php-8.3-debug-zts
263291
env:
264-
PHP: "8.2"
292+
PHP: "8.3"
265293
enable_debug: "yes"
266294
enable_zts: "yes"
267295
enable_session: "yes"
@@ -287,9 +315,9 @@ jobs:
287315
make -f scripts/ci/Makefile test
288316
289317
cur-dbg-zts-1:
290-
name: php-8.2-nodebug-zts
318+
name: php-8.3-nodebug-zts
291319
env:
292-
PHP: "8.2"
320+
PHP: "8.3"
293321
enable_debug: "no"
294322
enable_zts: "yes"
295323
enable_session: "yes"
@@ -315,9 +343,9 @@ jobs:
315343
make -f scripts/ci/Makefile test
316344
317345
cur-dbg-zts-2:
318-
name: php-8.2-debug-nozts
346+
name: php-8.3-debug-nozts
319347
env:
320-
PHP: "8.2"
348+
PHP: "8.3"
321349
enable_debug: "yes"
322350
enable_zts: "no"
323351
enable_session: "yes"
@@ -343,9 +371,9 @@ jobs:
343371
make -f scripts/ci/Makefile test
344372
345373
cur-dbg-zts-3:
346-
name: php-8.2-nodebug-nozts
374+
name: php-8.3-nodebug-nozts
347375
env:
348-
PHP: "8.2"
376+
PHP: "8.3"
349377
enable_debug: "no"
350378
enable_zts: "no"
351379
enable_session: "yes"
@@ -371,11 +399,11 @@ jobs:
371399
make -f scripts/ci/Makefile test
372400
373401
cur-cov-0:
374-
name: php-8.2-nodebug-nozts
402+
name: php-8.3-nodebug-nozts
375403
env:
376404
CFLAGS: "-O0 -g --coverage"
377405
CXXFLAGS: "-O0 -g --coverage"
378-
PHP: "8.2"
406+
PHP: "8.3"
379407
enable_session: "yes"
380408
runs-on: ubuntu-20.04
381409
steps:

package.xml

+8-9
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,20 @@
2222
<email>mike@php.net</email>
2323
<active>yes</active>
2424
</lead>
25-
<date>2023-06-02</date>
25+
<date>2024-08-30</date>
2626
<version>
27-
<release>2.2.0</release>
28-
<api>2.2.0</api>
27+
<release>3.0.0</release>
28+
<api>3.0.0</api>
2929
</version>
3030
<stability>
3131
<release>stable</release>
3232
<api>stable</api>
3333
</stability>
3434
<license filesource="LICENSE">3-Clause-BSD</license>
3535
<notes><![CDATA[
36-
No changes from RC2.
37-
* RC2:
38-
* Fix PHP-8.2 compatibility (see gh issue #165)
39-
* RC1:
40-
* Fix PHP-8.1 compatibility (see gh issues #161, #157, and #156)
41-
* Add support for ZEND_ACC_NOT_SERIALIZABLE and magic __{,un}serialize
36+
* Add support for PHP-8.1 Enums
37+
* merges #173
38+
* fixes #171
4239
]]></notes>
4340
<contents>
4441
<dir name="/">
@@ -191,6 +188,7 @@ No changes from RC2.
191188
<file name="bug011.phpt" role="test" />
192189
<file name="bug012.phpt" role="test" />
193190
<file name="bug013.phpt" role="test" />
191+
<file name="enum001.phpt" role="test" />
194192
<file name="issue023.phpt" role="test" />
195193
<file name="issue067.phpt" role="test" />
196194
<file name="issue067_32bit.phpt" role="test" />
@@ -205,6 +203,7 @@ No changes from RC2.
205203
<file name="issue139.phpt" role="test" />
206204
<file name="issue149.phpt" role="test" />
207205
<file name="issue149.ser.txt" role="test" />
206+
<file name="issue171.phpt" role="test" />
208207
</dir>
209208
</dir>
210209
</contents>

php_msgpack.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "Zend/zend_smart_str.h" /* for smart_string */
55

6-
#define PHP_MSGPACK_VERSION "2.2.0"
6+
#define PHP_MSGPACK_VERSION "3.0.0"
77

88
extern zend_module_entry msgpack_module_entry;
99
#define phpext_msgpack_ptr &msgpack_module_entry

scripts/gen_github_workflow_ci.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function jobname(string $id, array $env) : string {
2424
return sprintf("php-%s-%s-%s", $env["PHP"], yesno($env, "debug"), yesno($env, "zts"));
2525
}
2626
$gen = include __DIR__ . "/ci/gen-matrix.php";
27-
$cur = "8.2";
27+
$cur = "8.3";
2828
$job = $gen->github([
2929
"old-matrix" => [
3030
// most useful for all additional versions except current
@@ -42,7 +42,7 @@ function jobname(string $id, array $env) : string {
4242
],
4343
"cur-matrix" => [
4444
// most useful for all additional versions except current
45-
"PHP" => ["8.0", "8.1"],
45+
"PHP" => ["8.0", "8.1", "8.2"],
4646
"enable_debug" => "yes",
4747
"enable_zts" => "yes",
4848
"enable_session" => "yes",

tests/enum001.phpt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Enums
3+
--FILE--
4+
<?php
5+
echo "Test\n";
6+
enum Enum {
7+
case A;
8+
case B;
9+
case C;
10+
}
11+
$a = [Enum::A,Enum::B,Enum::C];
12+
$b = msgpack_unpack(msgpack_pack([Enum::A,Enum::B,Enum::C]));
13+
var_dump($a == $b);
14+
?>
15+
DONE
16+
--EXPECT--
17+
Test
18+
bool(true)
19+
DONE

0 commit comments

Comments
 (0)