diff --git a/packages/php-wasm/compile/php/Dockerfile b/packages/php-wasm/compile/php/Dockerfile index b5f725c98a..9854fbc9b6 100644 --- a/packages/php-wasm/compile/php/Dockerfile +++ b/packages/php-wasm/compile/php/Dockerfile @@ -776,6 +776,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "__vfprintf_internal",\ "vfprintf",\ "vsnprintf",\ +"var_destroy",\ "__xmlRaiseError",\ "__xmlLoaderErr",\ "zim_SoapClient___construct",\ @@ -824,6 +825,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "_erealloc",\ "_erealloc2",\ "_estrdup",\ +"_efree_large",\ "_get_zval_cv_lookup",\ "_is_numeric_string_ex",\ "_mysqlnd_init_ps_subsystem",\ @@ -872,6 +874,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "_zval_dtor_func_for_ptr",\ "_zval_dtor_func",\ "_zval_ptr_dtor",\ +"_zval_undefined_op1",\ "add_property_resource_ex",\ "autoVacuumCommit",\ "bsearch",\ @@ -882,6 +885,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "call",\ "callCollNeeded",\ "callFinaliser",\ +"concat_function",\ "checkTreePage",\ "cleanup_unfinished_calls",\ "clearDatabasePage",\ @@ -1016,6 +1020,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "ZEND_FE_FETCH_R_SPEC_VAR_HANDLER",\ "zend_generator_resume",\ "zend_generator_iterator_rewind",\ +"zend_get_properties_for",\ "zend_fe_reset_iterator",\ "ZEND_FE_RESET_R_SPEC_VAR_HANDLER",\ "zend_user_it_get_new_iterator",\ @@ -1042,6 +1047,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "zif_array_filter",\ "zend_unclean_zval_ptr_dtor",\ "zend_call_known_instance_method_with_2_params",\ +"ZEND_CALL_TRAMPOLINE_SPEC_HANDLER",\ "ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_HANDLER",\ "zend_fetch_dimension_address_read_R",\ "_zval_dtor_func_for_ptr",\ @@ -1086,6 +1092,8 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "zend_std_write_property",\ "ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DATA_CONST_HANDLER",\ "zend_objects_store_del",\ +"ZEND_CLONE_SPEC_CV_HANDLER",\ +"ZEND_CONCAT_SPEC_CONST_CV_HANDLER",\ "ZEND_UNSET_CV_SPEC_CV_UNUSED_HANDLER",\ "ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER",\ "ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER",\ @@ -1393,9 +1401,12 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "php_openssl_sockop_read",\ "php_openssl_sockop_set_option",\ "php_openssl_sockop_write",\ +"php_output_op",\ +"php_output_write",\ "php_pcre_replace_func_impl",\ "php_pdo_free_statement",\ "php_pollfd_for",\ +"php_printf_to_smart_str",\ "php_replace_in_subject_func",\ "php_request_shutdown",\ "php_sock_stream_wait_for_data",\ @@ -1428,12 +1439,14 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "php_stream_xport_register",\ "php_tcp_sockop_set_option",\ "php_tick_iterator",\ +"php_unserialize_with_options",\ "php_url_encode_hash_ex",\ "php_userstreamop_read",\ "php_userstreamop_set_option",\ "php_var_dump",\ "php_var_serialize_intern",\ "php_var_unserialize_internal",\ +"php_var_unserialize_destroy",\ "php_verror",\ "php_wasm_init",\ "php_zend_stream_closer",\ @@ -1740,6 +1753,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "wasm_sapi_request_shutdown",\ "wasm_sleep",\ "wrapper_cmp",\ +"xbuf_format_converter",\ "yy_reduce",\ "zend_activate_auto_globals",\ "zend_activate_modules",\ @@ -1825,6 +1839,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "zend_execute",\ "zend_extension_statement_handler",\ "ZEND_EXT_STMT_SPEC_HANDLER",\ +"ZEND_ECHO_SPEC_CV_HANDLER",\ "ZEND_FE_FETCH_R_SPEC_VAR_HANDLER",\ "zend_fe_reset_iterator",\ "ZEND_FE_RESET_R_SPEC_VAR_HANDLER",\ @@ -1859,6 +1874,7 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "zend_hash_del_key_or_index",\ "zend_hash_graceful_reverse_destroy",\ "zend_hash_reverse_apply",\ +"zend_hash_destroy",\ "ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER",\ "ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER",\ "zend_include_or_eval",\ @@ -1946,7 +1962,9 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "zend_startup",\ "zend_std_call_getter",\ "zend_std_call_user_call",\ +"zend_std_cast_object_tostring",\ "zend_std_compare_objects",\ +"zend_std_get_debug_info",\ "zend_std_has_dimension",\ "zend_std_has_property",\ "zend_std_read_dimension",\ @@ -2119,8 +2137,11 @@ RUN export ASYNCIFY_IMPORTS=$'[\n\ "zif_stream_socket_client",\ "zif_stream_socket_enable_crypto",\ "zif_system",\ +"zif_serialize",\ +"zif_unserialize",\ "zif_touch",\ "zif_unlink",\ +"zif_var_dump",\ "zif_wasm_popen",\ "zim_AppendIterator_append",\ "zim_AppendIterator_current",\ diff --git a/packages/php-wasm/node-builds/7-2/asyncify/7_2_34/php_7_2.wasm b/packages/php-wasm/node-builds/7-2/asyncify/7_2_34/php_7_2.wasm old mode 100755 new mode 100644 index dbd8fbf7ac..c7f3c0bf08 Binary files a/packages/php-wasm/node-builds/7-2/asyncify/7_2_34/php_7_2.wasm and b/packages/php-wasm/node-builds/7-2/asyncify/7_2_34/php_7_2.wasm differ diff --git a/packages/php-wasm/node-builds/7-2/asyncify/php_7_2.js b/packages/php-wasm/node-builds/7-2/asyncify/php_7_2.js index a48070a10b..a072913ece 100644 --- a/packages/php-wasm/node-builds/7-2/asyncify/php_7_2.js +++ b/packages/php-wasm/node-builds/7-2/asyncify/php_7_2.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '7_2_34', 'php_7_2.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 22621562; +export const dependenciesTotalSize = 22634605; const phpVersionString = '7.2.34'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/7-2/jspi/7_2_34/php_7_2.wasm b/packages/php-wasm/node-builds/7-2/jspi/7_2_34/php_7_2.wasm old mode 100755 new mode 100644 index bf8fc33e5e..5562c574da Binary files a/packages/php-wasm/node-builds/7-2/jspi/7_2_34/php_7_2.wasm and b/packages/php-wasm/node-builds/7-2/jspi/7_2_34/php_7_2.wasm differ diff --git a/packages/php-wasm/node-builds/7-2/jspi/php_7_2.js b/packages/php-wasm/node-builds/7-2/jspi/php_7_2.js index d2352183ac..a31d716418 100644 --- a/packages/php-wasm/node-builds/7-2/jspi/php_7_2.js +++ b/packages/php-wasm/node-builds/7-2/jspi/php_7_2.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '7_2_34', 'php_7_2.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 22140869; +export const dependenciesTotalSize = 22140881; const phpVersionString = '7.2.34'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/7-3/asyncify/7_3_33/php_7_3.wasm b/packages/php-wasm/node-builds/7-3/asyncify/7_3_33/php_7_3.wasm old mode 100755 new mode 100644 index 2861a708a0..b3545f39c9 Binary files a/packages/php-wasm/node-builds/7-3/asyncify/7_3_33/php_7_3.wasm and b/packages/php-wasm/node-builds/7-3/asyncify/7_3_33/php_7_3.wasm differ diff --git a/packages/php-wasm/node-builds/7-3/asyncify/php_7_3.js b/packages/php-wasm/node-builds/7-3/asyncify/php_7_3.js index 50f9249245..6021c84469 100644 --- a/packages/php-wasm/node-builds/7-3/asyncify/php_7_3.js +++ b/packages/php-wasm/node-builds/7-3/asyncify/php_7_3.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '7_3_33', 'php_7_3.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 22663138; +export const dependenciesTotalSize = 22674744; const phpVersionString = '7.3.33'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/7-3/jspi/7_3_33/php_7_3.wasm b/packages/php-wasm/node-builds/7-3/jspi/7_3_33/php_7_3.wasm old mode 100755 new mode 100644 index e532995395..4f65bb58ac Binary files a/packages/php-wasm/node-builds/7-3/jspi/7_3_33/php_7_3.wasm and b/packages/php-wasm/node-builds/7-3/jspi/7_3_33/php_7_3.wasm differ diff --git a/packages/php-wasm/node-builds/7-3/jspi/php_7_3.js b/packages/php-wasm/node-builds/7-3/jspi/php_7_3.js index 25a410c0f4..bfb852632f 100644 --- a/packages/php-wasm/node-builds/7-3/jspi/php_7_3.js +++ b/packages/php-wasm/node-builds/7-3/jspi/php_7_3.js @@ -7,6 +7,8 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname diff --git a/packages/php-wasm/node-builds/7-4/asyncify/7_4_33/php_7_4.wasm b/packages/php-wasm/node-builds/7-4/asyncify/7_4_33/php_7_4.wasm old mode 100755 new mode 100644 index 83377452a5..ba4dad6331 Binary files a/packages/php-wasm/node-builds/7-4/asyncify/7_4_33/php_7_4.wasm and b/packages/php-wasm/node-builds/7-4/asyncify/7_4_33/php_7_4.wasm differ diff --git a/packages/php-wasm/node-builds/7-4/asyncify/php_7_4.js b/packages/php-wasm/node-builds/7-4/asyncify/php_7_4.js index 6ffe5d8312..2d22c16e95 100644 --- a/packages/php-wasm/node-builds/7-4/asyncify/php_7_4.js +++ b/packages/php-wasm/node-builds/7-4/asyncify/php_7_4.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '7_4_33', 'php_7_4.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 22934485; +export const dependenciesTotalSize = 22947627; const phpVersionString = '7.4.33'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/7-4/jspi/7_4_33/php_7_4.wasm b/packages/php-wasm/node-builds/7-4/jspi/7_4_33/php_7_4.wasm old mode 100755 new mode 100644 index e1644e2f29..1449b90508 Binary files a/packages/php-wasm/node-builds/7-4/jspi/7_4_33/php_7_4.wasm and b/packages/php-wasm/node-builds/7-4/jspi/7_4_33/php_7_4.wasm differ diff --git a/packages/php-wasm/node-builds/7-4/jspi/php_7_4.js b/packages/php-wasm/node-builds/7-4/jspi/php_7_4.js index 0f649e51cd..8cd961a65a 100644 --- a/packages/php-wasm/node-builds/7-4/jspi/php_7_4.js +++ b/packages/php-wasm/node-builds/7-4/jspi/php_7_4.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '7_4_33', 'php_7_4.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 22427158; +export const dependenciesTotalSize = 22427157; const phpVersionString = '7.4.33'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-0/asyncify/8_0_30/php_8_0.wasm b/packages/php-wasm/node-builds/8-0/asyncify/8_0_30/php_8_0.wasm old mode 100755 new mode 100644 index 910aefc834..d8d29fefa3 Binary files a/packages/php-wasm/node-builds/8-0/asyncify/8_0_30/php_8_0.wasm and b/packages/php-wasm/node-builds/8-0/asyncify/8_0_30/php_8_0.wasm differ diff --git a/packages/php-wasm/node-builds/8-0/asyncify/php_8_0.js b/packages/php-wasm/node-builds/8-0/asyncify/php_8_0.js index a38f2973e7..17fe9653a0 100644 --- a/packages/php-wasm/node-builds/8-0/asyncify/php_8_0.js +++ b/packages/php-wasm/node-builds/8-0/asyncify/php_8_0.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_0_30', 'php_8_0.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 23234949; +export const dependenciesTotalSize = 23248161; const phpVersionString = '8.0.30'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-0/jspi/8_0_30/php_8_0.wasm b/packages/php-wasm/node-builds/8-0/jspi/8_0_30/php_8_0.wasm old mode 100755 new mode 100644 index f85b1339d2..d2f7d95d9d Binary files a/packages/php-wasm/node-builds/8-0/jspi/8_0_30/php_8_0.wasm and b/packages/php-wasm/node-builds/8-0/jspi/8_0_30/php_8_0.wasm differ diff --git a/packages/php-wasm/node-builds/8-0/jspi/php_8_0.js b/packages/php-wasm/node-builds/8-0/jspi/php_8_0.js index a05f7aded1..9eb80bec72 100644 --- a/packages/php-wasm/node-builds/8-0/jspi/php_8_0.js +++ b/packages/php-wasm/node-builds/8-0/jspi/php_8_0.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_0_30', 'php_8_0.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 22718313; +export const dependenciesTotalSize = 22718314; const phpVersionString = '8.0.30'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-1/asyncify/8_1_34/php_8_1.wasm b/packages/php-wasm/node-builds/8-1/asyncify/8_1_34/php_8_1.wasm old mode 100755 new mode 100644 index 1620fdabb0..97531ef710 Binary files a/packages/php-wasm/node-builds/8-1/asyncify/8_1_34/php_8_1.wasm and b/packages/php-wasm/node-builds/8-1/asyncify/8_1_34/php_8_1.wasm differ diff --git a/packages/php-wasm/node-builds/8-1/asyncify/php_8_1.js b/packages/php-wasm/node-builds/8-1/asyncify/php_8_1.js index 73da2763bd..4d3293f6ee 100644 --- a/packages/php-wasm/node-builds/8-1/asyncify/php_8_1.js +++ b/packages/php-wasm/node-builds/8-1/asyncify/php_8_1.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_1_34', 'php_8_1.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 27231603; +export const dependenciesTotalSize = 27245052; const phpVersionString = '8.1.34'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-1/jspi/8_1_34/php_8_1.wasm b/packages/php-wasm/node-builds/8-1/jspi/8_1_34/php_8_1.wasm old mode 100755 new mode 100644 index e8f1ab9df7..d06fb2ccfe Binary files a/packages/php-wasm/node-builds/8-1/jspi/8_1_34/php_8_1.wasm and b/packages/php-wasm/node-builds/8-1/jspi/8_1_34/php_8_1.wasm differ diff --git a/packages/php-wasm/node-builds/8-1/jspi/php_8_1.js b/packages/php-wasm/node-builds/8-1/jspi/php_8_1.js index bf7870b5c3..6abf415e09 100644 --- a/packages/php-wasm/node-builds/8-1/jspi/php_8_1.js +++ b/packages/php-wasm/node-builds/8-1/jspi/php_8_1.js @@ -7,6 +7,8 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname diff --git a/packages/php-wasm/node-builds/8-2/asyncify/8_2_30/php_8_2.wasm b/packages/php-wasm/node-builds/8-2/asyncify/8_2_30/php_8_2.wasm old mode 100755 new mode 100644 index b24d166515..049e0043ec Binary files a/packages/php-wasm/node-builds/8-2/asyncify/8_2_30/php_8_2.wasm and b/packages/php-wasm/node-builds/8-2/asyncify/8_2_30/php_8_2.wasm differ diff --git a/packages/php-wasm/node-builds/8-2/asyncify/php_8_2.js b/packages/php-wasm/node-builds/8-2/asyncify/php_8_2.js index f595d70d53..94d6f53f62 100644 --- a/packages/php-wasm/node-builds/8-2/asyncify/php_8_2.js +++ b/packages/php-wasm/node-builds/8-2/asyncify/php_8_2.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_2_30', 'php_8_2.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 27520165; +export const dependenciesTotalSize = 27534591; const phpVersionString = '8.2.30'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-2/jspi/8_2_30/php_8_2.wasm b/packages/php-wasm/node-builds/8-2/jspi/8_2_30/php_8_2.wasm old mode 100755 new mode 100644 index 9e2e009ded..c48c81d571 Binary files a/packages/php-wasm/node-builds/8-2/jspi/8_2_30/php_8_2.wasm and b/packages/php-wasm/node-builds/8-2/jspi/8_2_30/php_8_2.wasm differ diff --git a/packages/php-wasm/node-builds/8-2/jspi/php_8_2.js b/packages/php-wasm/node-builds/8-2/jspi/php_8_2.js index 831d96d5ad..ada4c66ce6 100644 --- a/packages/php-wasm/node-builds/8-2/jspi/php_8_2.js +++ b/packages/php-wasm/node-builds/8-2/jspi/php_8_2.js @@ -7,6 +7,8 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname diff --git a/packages/php-wasm/node-builds/8-3/asyncify/8_3_29/php_8_3.wasm b/packages/php-wasm/node-builds/8-3/asyncify/8_3_29/php_8_3.wasm old mode 100755 new mode 100644 index 93da6e3ede..6e6340643b Binary files a/packages/php-wasm/node-builds/8-3/asyncify/8_3_29/php_8_3.wasm and b/packages/php-wasm/node-builds/8-3/asyncify/8_3_29/php_8_3.wasm differ diff --git a/packages/php-wasm/node-builds/8-3/asyncify/php_8_3.js b/packages/php-wasm/node-builds/8-3/asyncify/php_8_3.js index 43be2ffb95..30d1a876d3 100644 --- a/packages/php-wasm/node-builds/8-3/asyncify/php_8_3.js +++ b/packages/php-wasm/node-builds/8-3/asyncify/php_8_3.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_3_29', 'php_8_3.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 27938515; +export const dependenciesTotalSize = 27953562; const phpVersionString = '8.3.29'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-3/jspi/8_3_29/php_8_3.wasm b/packages/php-wasm/node-builds/8-3/jspi/8_3_29/php_8_3.wasm old mode 100755 new mode 100644 index a5c97d23b3..e2b6fe9c8e Binary files a/packages/php-wasm/node-builds/8-3/jspi/8_3_29/php_8_3.wasm and b/packages/php-wasm/node-builds/8-3/jspi/8_3_29/php_8_3.wasm differ diff --git a/packages/php-wasm/node-builds/8-3/jspi/php_8_3.js b/packages/php-wasm/node-builds/8-3/jspi/php_8_3.js index 9acbc912fc..2d9da9b82a 100644 --- a/packages/php-wasm/node-builds/8-3/jspi/php_8_3.js +++ b/packages/php-wasm/node-builds/8-3/jspi/php_8_3.js @@ -7,6 +7,8 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname diff --git a/packages/php-wasm/node-builds/8-4/asyncify/8_4_16/php_8_4.wasm b/packages/php-wasm/node-builds/8-4/asyncify/8_4_16/php_8_4.wasm old mode 100755 new mode 100644 index 02707c4853..3218b2094a Binary files a/packages/php-wasm/node-builds/8-4/asyncify/8_4_16/php_8_4.wasm and b/packages/php-wasm/node-builds/8-4/asyncify/8_4_16/php_8_4.wasm differ diff --git a/packages/php-wasm/node-builds/8-4/asyncify/php_8_4.js b/packages/php-wasm/node-builds/8-4/asyncify/php_8_4.js index ec00b89301..3f6920001f 100644 --- a/packages/php-wasm/node-builds/8-4/asyncify/php_8_4.js +++ b/packages/php-wasm/node-builds/8-4/asyncify/php_8_4.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_4_16', 'php_8_4.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 29857658; +export const dependenciesTotalSize = 29872765; const phpVersionString = '8.4.16'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-4/jspi/8_4_16/php_8_4.wasm b/packages/php-wasm/node-builds/8-4/jspi/8_4_16/php_8_4.wasm old mode 100755 new mode 100644 index 353bba2dac..30ade4b931 Binary files a/packages/php-wasm/node-builds/8-4/jspi/8_4_16/php_8_4.wasm and b/packages/php-wasm/node-builds/8-4/jspi/8_4_16/php_8_4.wasm differ diff --git a/packages/php-wasm/node-builds/8-4/jspi/php_8_4.js b/packages/php-wasm/node-builds/8-4/jspi/php_8_4.js index 178a669399..2177784102 100644 --- a/packages/php-wasm/node-builds/8-4/jspi/php_8_4.js +++ b/packages/php-wasm/node-builds/8-4/jspi/php_8_4.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_4_16', 'php_8_4.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 29265092; +export const dependenciesTotalSize = 29265082; const phpVersionString = '8.4.16'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-5/asyncify/8_5_1/php_8_5.wasm b/packages/php-wasm/node-builds/8-5/asyncify/8_5_1/php_8_5.wasm old mode 100755 new mode 100644 index 0f479a96b1..8a591bfa20 Binary files a/packages/php-wasm/node-builds/8-5/asyncify/8_5_1/php_8_5.wasm and b/packages/php-wasm/node-builds/8-5/asyncify/8_5_1/php_8_5.wasm differ diff --git a/packages/php-wasm/node-builds/8-5/asyncify/php_8_5.js b/packages/php-wasm/node-builds/8-5/asyncify/php_8_5.js index 550455391f..a29c209826 100644 --- a/packages/php-wasm/node-builds/8-5/asyncify/php_8_5.js +++ b/packages/php-wasm/node-builds/8-5/asyncify/php_8_5.js @@ -7,13 +7,15 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); const dependencyFilename = path.join(currentDirPath, '8_5_1', 'php_8_5.wasm'); export { dependencyFilename }; -export const dependenciesTotalSize = 31304989; +export const dependenciesTotalSize = 31320248; const phpVersionString = '8.5.1'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/node-builds/8-5/jspi/8_5_1/php_8_5.wasm b/packages/php-wasm/node-builds/8-5/jspi/8_5_1/php_8_5.wasm old mode 100755 new mode 100644 index c338ed0382..4811f4bb9d Binary files a/packages/php-wasm/node-builds/8-5/jspi/8_5_1/php_8_5.wasm and b/packages/php-wasm/node-builds/8-5/jspi/8_5_1/php_8_5.wasm differ diff --git a/packages/php-wasm/node-builds/8-5/jspi/php_8_5.js b/packages/php-wasm/node-builds/8-5/jspi/php_8_5.js index 972674d2cd..a6ba11769e 100644 --- a/packages/php-wasm/node-builds/8-5/jspi/php_8_5.js +++ b/packages/php-wasm/node-builds/8-5/jspi/php_8_5.js @@ -7,6 +7,8 @@ const require = createRequire(import.meta.url); import path from 'path'; import { fileURLToPath } from 'url'; +// Determine the current directory path. In CJS mode, __dirname is available. +// In ESM mode, we derive it from import.meta.url. const currentDirPath = typeof __dirname !== 'undefined' ? __dirname diff --git a/packages/php-wasm/node/src/test/php-file-get-contents.spec.ts b/packages/php-wasm/node/src/test/php-file-get-contents.spec.ts index f51711dbae..e2bcfbcc5b 100644 --- a/packages/php-wasm/node/src/test/php-file-get-contents.spec.ts +++ b/packages/php-wasm/node/src/test/php-file-get-contents.spec.ts @@ -46,24 +46,29 @@ const httpsServer = https.createServer( requestHandler ); -[ - { - protocol: 'http', - port: new Promise((resolve) => { - httpServer.listen(0, function () { - resolve((httpServer.address() as any).port); +const startServerAndGetConfig = async ( + protocol: string, + server: http.Server | https.Server +): Promise<{ + protocol: string; + port: number; +}> => { + return new Promise((resolve) => { + server.listen(0, () => { + resolve({ + protocol, + port: (server.address() as any).port, }); - }), - }, - { - protocol: 'https', - port: new Promise((resolve) => { - httpsServer.listen(0, function () { - resolve((httpsServer.address() as any).port); - }); - }), - }, -].forEach(({ protocol, port }) => { + }); + }); +}; + +const serverConfigs = await Promise.all([ + startServerAndGetConfig('http', httpServer), + startServerAndGetConfig('https', httpsServer), +]); + +serverConfigs.forEach(({ protocol, port }) => { const host = '127.0.0.1'; const httpUrl = `${protocol}://${host}:${port}`; @@ -177,53 +182,6 @@ const httpsServer = https.createServer( function my_method() { ${networkCall} } } call_user_func_array([new Top(), 'my_method'], []); - `)); - test('Constructor', () => - assertNoCrash(` - class Top { - function __construct() { ${networkCall} } - } - new Top(); - `)); - test('Destructor', () => - assertNoCrash(` - class Top { - function __destruct() { ${networkCall} } - } - $x = new Top(); - unset($x); - `)); - test('__call', () => - assertNoCrash(` - class Top { - function __call($method, $args) { ${networkCall} } - } - $x = new Top(); - $x->test(); - `)); - test('__get', () => - assertNoCrash(` - class Top { - function __get($prop) { ${networkCall} } - } - $x = new Top(); - $x->test; - `)); - test('__set', () => - assertNoCrash(` - class Top { - function __set($prop, $value) { ${networkCall} } - } - $x = new Top(); - $x->test = 1; - `)); - test('__isset', () => - assertNoCrash(` - class Top { - function __isset($prop) { ${networkCall} } - } - $x = new Top(); - isset($x->test); `)); test('ArrayAccess', () => { assertNoCrash(` @@ -278,6 +236,165 @@ const httpsServer = https.createServer( `)); }); + /** + * Verifies that PHP magic methods can invoke asynchronous functions such as file_get_contents, + * correctly handle their results, and ensure proper stack management and context switching. + * + * @see https://www.php.net/manual/en/language.oop5.magic.php + */ + describe('PHP Magic Methods', () => { + it('__construct', () => { + return assertNoCrash(` + class Top { + function __construct() { ${networkCall} } + } + new Top();`); + }); + + it('__destruct', () => { + return assertNoCrash(` + class Top { + function __destruct() { ${networkCall} } + } + $x = new Top();`); + }); + + it('__call', () => { + return assertNoCrash(` + class Top { + function __call($method, $args) { ${networkCall} } + } + $x = new Top(); + $x->test();`); + }); + + it('__callStatic', () => { + return assertNoCrash(` + class Top { + static function __callStatic($method, $args) { ${networkCall} } + } + Top::test();`); + }); + + it('__get', () => { + return assertNoCrash(` + class Top { + function __get($prop) { ${networkCall} } + } + $x = new Top(); + $a = $x->test;`); + }); + + it('__set', () => { + return assertNoCrash(` + class Top { + function __set($prop, $value) { ${networkCall} } + } + $x = new Top(); + $x->test = 1;`); + }); + + it('__isset', () => { + return assertNoCrash(` + class Top { + function __isset($prop) { ${networkCall} } + } + $x = new Top(); + isset($x->test); + empty($x->test);`); + }); + + it('__unset', () => { + return assertNoCrash(` + class Top { + function __unset($prop) { ${networkCall} } + } + $x = new Top(); + unset($x->test);`); + }); + + it('__sleep', () => { + return assertNoCrash(` + class Top { + function __sleep() { ${networkCall} return []; } + } + $x = new Top(); + serialize($x);`); + }); + + it('__wakeup', () => { + return assertNoCrash(` + class Top { + function __wakeup() { ${networkCall} } + } + $serialized = serialize(new Top()); + unserialize($serialized);`); + }); + + it('__serialize', () => { + return assertNoCrash(` + class Top { + function __serialize() { ${networkCall} return []; } + } + $x = new Top(); + serialize($x);`); + }); + + it('__unserialize', () => { + return assertNoCrash(` + class Top { + function __unserialize($data) { ${networkCall} } + } + $serialized = serialize(new Top()); + unserialize($serialized);`); + }); + + it('__toString', () => { + return assertNoCrash(` + class Top { + function __toString() { ${networkCall} return ""; } + } + $x = new Top(); + echo $x;`); + }); + + it('__invoke', () => { + return assertNoCrash(` + class Top { + function __invoke() { ${networkCall} } + } + $x = new Top(); + $x();`); + }); + + it('__set_state', () => { + return assertNoCrash(` + class Top { + static function __set_state($an_array) { ${networkCall} } + } + $exported = var_export(new Top(), true); + eval('$x = ' . $exported . ';');`); + }); + + it('__clone', () => { + return assertNoCrash(` + class Top { + function __clone() { ${networkCall} } + } + $x = new Top(); + $y = clone $x;`); + }); + + it('__debugInfo', () => { + return assertNoCrash(` + class Top { + function __debugInfo() { ${networkCall} return []; } + } + $x = new Top(); + var_dump($x);`); + }); + }); + describe('exif extension support', () => { it('exif_read_data', async () => { assertNoCrash( diff --git a/packages/php-wasm/supported-php-versions.mjs b/packages/php-wasm/supported-php-versions.mjs index 7a9f3ffab7..5c3001be34 100644 --- a/packages/php-wasm/supported-php-versions.mjs +++ b/packages/php-wasm/supported-php-versions.mjs @@ -6,7 +6,7 @@ * @property {string} lastRelease */ -export const lastRefreshed = '2025-12-31T10:46:36.047Z'; +export const lastRefreshed = '2026-01-08T15:34:54.643Z'; /** * @type {PhpVersion[]} diff --git a/packages/php-wasm/web-builds/7-2/asyncify/7_2_34/php_7_2.wasm b/packages/php-wasm/web-builds/7-2/asyncify/7_2_34/php_7_2.wasm old mode 100755 new mode 100644 index 87c3fed398..704ffc87b1 Binary files a/packages/php-wasm/web-builds/7-2/asyncify/7_2_34/php_7_2.wasm and b/packages/php-wasm/web-builds/7-2/asyncify/7_2_34/php_7_2.wasm differ diff --git a/packages/php-wasm/web-builds/7-2/asyncify/php_7_2.js b/packages/php-wasm/web-builds/7-2/asyncify/php_7_2.js index c7e069088c..d30ffb7bb9 100644 --- a/packages/php-wasm/web-builds/7-2/asyncify/php_7_2.js +++ b/packages/php-wasm/web-builds/7-2/asyncify/php_7_2.js @@ -1,6 +1,6 @@ import dependencyFilename from './7_2_34/php_7_2.wasm'; export { dependencyFilename }; -export const dependenciesTotalSize = 20181230; +export const dependenciesTotalSize = 20194272; const phpVersionString = '7.2.34'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/web-builds/7-2/jspi/7_2_34/php_7_2.wasm b/packages/php-wasm/web-builds/7-2/jspi/7_2_34/php_7_2.wasm old mode 100755 new mode 100644 index 8986683fc1..719714e75a Binary files a/packages/php-wasm/web-builds/7-2/jspi/7_2_34/php_7_2.wasm and b/packages/php-wasm/web-builds/7-2/jspi/7_2_34/php_7_2.wasm differ diff --git a/packages/php-wasm/web-builds/7-2/jspi/php_7_2.js b/packages/php-wasm/web-builds/7-2/jspi/php_7_2.js index 0d11689c12..69695c8d7c 100644 --- a/packages/php-wasm/web-builds/7-2/jspi/php_7_2.js +++ b/packages/php-wasm/web-builds/7-2/jspi/php_7_2.js @@ -1,6 +1,6 @@ import dependencyFilename from './7_2_34/php_7_2.wasm'; export { dependencyFilename }; -export const dependenciesTotalSize = 19763601; +export const dependenciesTotalSize = 19763602; const phpVersionString = '7.2.34'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/web-builds/7-3/asyncify/7_3_33/php_7_3.wasm b/packages/php-wasm/web-builds/7-3/asyncify/7_3_33/php_7_3.wasm old mode 100755 new mode 100644 index 484fcaee3a..13932756fa Binary files a/packages/php-wasm/web-builds/7-3/asyncify/7_3_33/php_7_3.wasm and b/packages/php-wasm/web-builds/7-3/asyncify/7_3_33/php_7_3.wasm differ diff --git a/packages/php-wasm/web-builds/7-3/asyncify/php_7_3.js b/packages/php-wasm/web-builds/7-3/asyncify/php_7_3.js index ea99db64dd..fe5753e6b5 100644 --- a/packages/php-wasm/web-builds/7-3/asyncify/php_7_3.js +++ b/packages/php-wasm/web-builds/7-3/asyncify/php_7_3.js @@ -1,6 +1,6 @@ import dependencyFilename from './7_3_33/php_7_3.wasm'; export { dependencyFilename }; -export const dependenciesTotalSize = 20184979; +export const dependenciesTotalSize = 20196586; const phpVersionString = '7.3.33'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/web-builds/7-3/jspi/7_3_33/php_7_3.wasm b/packages/php-wasm/web-builds/7-3/jspi/7_3_33/php_7_3.wasm old mode 100755 new mode 100644 index b45a505a8e..292234b1ce Binary files a/packages/php-wasm/web-builds/7-3/jspi/7_3_33/php_7_3.wasm and b/packages/php-wasm/web-builds/7-3/jspi/7_3_33/php_7_3.wasm differ diff --git a/packages/php-wasm/web-builds/7-4/asyncify/7_4_33/php_7_4.wasm b/packages/php-wasm/web-builds/7-4/asyncify/7_4_33/php_7_4.wasm old mode 100755 new mode 100644 index c6671ca6ef..83e9b9b027 Binary files a/packages/php-wasm/web-builds/7-4/asyncify/7_4_33/php_7_4.wasm and b/packages/php-wasm/web-builds/7-4/asyncify/7_4_33/php_7_4.wasm differ diff --git a/packages/php-wasm/web-builds/7-4/asyncify/php_7_4.js b/packages/php-wasm/web-builds/7-4/asyncify/php_7_4.js index 619800520e..06015dca9e 100644 --- a/packages/php-wasm/web-builds/7-4/asyncify/php_7_4.js +++ b/packages/php-wasm/web-builds/7-4/asyncify/php_7_4.js @@ -1,6 +1,6 @@ import dependencyFilename from './7_4_33/php_7_4.wasm'; export { dependencyFilename }; -export const dependenciesTotalSize = 20403496; +export const dependenciesTotalSize = 20416628; const phpVersionString = '7.4.33'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/web-builds/7-4/jspi/7_4_33/php_7_4.wasm b/packages/php-wasm/web-builds/7-4/jspi/7_4_33/php_7_4.wasm old mode 100755 new mode 100644 index bb0a46a96c..85ef4033aa Binary files a/packages/php-wasm/web-builds/7-4/jspi/7_4_33/php_7_4.wasm and b/packages/php-wasm/web-builds/7-4/jspi/7_4_33/php_7_4.wasm differ diff --git a/packages/php-wasm/web-builds/7-4/jspi/php_7_4.js b/packages/php-wasm/web-builds/7-4/jspi/php_7_4.js index a4ace50658..292eaa322a 100644 --- a/packages/php-wasm/web-builds/7-4/jspi/php_7_4.js +++ b/packages/php-wasm/web-builds/7-4/jspi/php_7_4.js @@ -1,6 +1,6 @@ import dependencyFilename from './7_4_33/php_7_4.wasm'; export { dependencyFilename }; -export const dependenciesTotalSize = 19964833; +export const dependenciesTotalSize = 19964836; const phpVersionString = '7.4.33'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm/web-builds/8-0/asyncify/8_0_30/php_8_0.wasm b/packages/php-wasm/web-builds/8-0/asyncify/8_0_30/php_8_0.wasm old mode 100755 new mode 100644 index 94ff916c6e..679bf929e1 Binary files a/packages/php-wasm/web-builds/8-0/asyncify/8_0_30/php_8_0.wasm and b/packages/php-wasm/web-builds/8-0/asyncify/8_0_30/php_8_0.wasm differ diff --git a/packages/php-wasm/web-builds/8-0/asyncify/php_8_0.js b/packages/php-wasm/web-builds/8-0/asyncify/php_8_0.js index 7c6bd05f0f..bca33df3bb 100644 --- a/packages/php-wasm/web-builds/8-0/asyncify/php_8_0.js +++ b/packages/php-wasm/web-builds/8-0/asyncify/php_8_0.js @@ -1,6 +1,6 @@ import dependencyFilename from './8_0_30/php_8_0.wasm'; export { dependencyFilename }; -export const dependenciesTotalSize = 20682510; +export const dependenciesTotalSize = 20695725; const phpVersionString = '8.0.30'; export function init(RuntimeName, PHPLoader) { // The rest of the code comes from the built php.js file and esm-suffix.js diff --git a/packages/php-wasm{"code":"internal","msg":"git-diff-tree: context deadline exceeded","meta":{"cause":"*fmt.wrapError"}}