Skip to content
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

PHP: Add zif_array_filter to Asyncify list #397

Merged
merged 1 commit into from
May 30, 2023
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
3 changes: 2 additions & 1 deletion packages/php-wasm/compile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ RUN if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; \
"dynCall_viiiii",\
"dynCall_viiiiiii",\
"dynCall_viiiiiiii",'; \
export ASYNCIFY_ONLY=$'"zend_call_known_instance_method_with_2_params",\
export ASYNCIFY_ONLY=$'"zif_array_filter",\
"zend_call_known_instance_method_with_2_params",\
"zend_fetch_dimension_address_read_R",\
"_zval_dtor_func_for_ptr",\
"ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER",\
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_5_6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10176192;
export const dependenciesTotalSize = 10176855;
const dependencyFilename = __dirname + '/php_5_6.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_5_6.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_0.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10389492;
export const dependenciesTotalSize = 10390258;
const dependencyFilename = __dirname + '/php_7_0.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_0.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10583119;
export const dependenciesTotalSize = 10583885;
const dependencyFilename = __dirname + '/php_7_1.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_1.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10992646;
export const dependenciesTotalSize = 10993354;
const dependencyFilename = __dirname + '/php_7_2.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_2.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10916038;
export const dependenciesTotalSize = 10916624;
const dependencyFilename = __dirname + '/php_7_3.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_3.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 11015985;
export const dependenciesTotalSize = 11016595;
const dependencyFilename = __dirname + '/php_7_4.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_7_4.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_0.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10172313;
export const dependenciesTotalSize = 10172733;
const dependencyFilename = __dirname + '/php_8_0.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_8_0.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10044311;
export const dependenciesTotalSize = 10044712;
const dependencyFilename = __dirname + '/php_8_1.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_8_1.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dependenciesTotalSize = 10302665;
export const dependenciesTotalSize = 10303111;
const dependencyFilename = __dirname + '/php_8_2.wasm';
export { dependencyFilename }; export function init(RuntimeName, PHPLoader) {
var Module = typeof PHPLoader != "undefined" ? PHPLoader : {};
Expand Down
Binary file modified packages/php-wasm/node/public/php_8_2.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/src/lib/node-php.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class NodePHP extends BasePHP {
*
* This method can only be used when PHP was compiled with the CLI SAPI
* and it cannot be used in conjunction with `run()`.
*
*
Copy link
Collaborator Author

@adamziel adamziel May 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird, I don't want prettier to do that.

* Once this method finishes running, the PHP instance is no
* longer usable and should be discarded. This is because PHP
* internally cleans up all the resources and calls exit().
Expand Down
16 changes: 16 additions & 0 deletions packages/php-wasm/node/src/test/php-asyncify.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ describe.each(phpVersions)('PHP %s – asyncify', (phpVersion) => {
));
});

describe('Array functions', () => {
test('array_filter', () =>
assertNoCrash(`
function top() { ${networkCall} }
array_filter(array('top'), 'top');
`));

test('array_map', () =>
assertNoCrash(`
function top() { ${networkCall} }
array_map(array('top'), 'top');
`));

// Network calls in sort() would be silly so let's skip those for now.
});

describe('Class method calls', () => {
test('Regular method', () =>
assertNoCrash(`
Expand Down