Skip to content

add ext-decimal#1095

Merged
henderkes merged 7 commits intomainfrom
feat/decimal
Apr 12, 2026
Merged

add ext-decimal#1095
henderkes merged 7 commits intomainfrom
feat/decimal

Conversation

@henderkes
Copy link
Copy Markdown
Collaborator

What does this PR do?

closes #1092

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@henderkes henderkes requested a review from crazywhalecc April 12, 2026 05:31
@henderkes
Copy link
Copy Markdown
Collaborator Author

@crazywhalecc no idea what's going on with windows, looks like it segfaults when running php. I can make windows shared-only if you don't want to figure this out.

@henderkes
Copy link
Copy Markdown
Collaborator Author

wait I have an idea... it might be doing stupid dllimport shenanigans

crazywhalecc added a commit that referenced this pull request Apr 12, 2026
@henderkes
Copy link
Copy Markdown
Collaborator Author

guessing not, no idea then. I don't have a SPC environment on windows.

@crazywhalecc
Copy link
Copy Markdown
Owner

I fixed on v3 branch: 75a7b21

decimal calls zend_class_implements(..., php_json_serializable_ce) in its MINIT. In static builds, PHP initialises extensions in the order listed in internal_functions.c, which is determined by configure's dependency graph. Without an explicit dep, "decimal" is registered before "json". Here's debug stack trace:

>	php.exe!do_interface_implementation(_zend_class_entry * ce, _zend_class_entry * iface) 行 2156	C
 	php.exe!zend_do_implement_interface(_zend_class_entry * ce, _zend_class_entry * iface) 行 2219	C
 	php.exe!zend_class_implements(_zend_class_entry * class_entry, int num_interfaces, ...) 行 3544	C
 	php.exe!php_decimal_register_number_class(...) 行 720	C
 	php.exe!zm_startup_decimal(int type, int module_number) 行 110	C
 	php.exe!zend_startup_module_ex(_zend_module_entry * module) 行 2446	C
 	php.exe!zend_startup_module_zval(_zval_struct * zv) 行 2461	C
 	php.exe!zend_hash_apply(_zend_array * ht, int(*)(_zval_struct *) apply_func) 行 2092	C
 	php.exe!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_module) 行 2293	C
 	php.exe!main(int argc, char * * argv) 行 1281	C

@crazywhalecc
Copy link
Copy Markdown
Owner

This should also be fixed upstream.

@henderkes
Copy link
Copy Markdown
Collaborator Author

Oh yeah absolutely, can you upstream a fix?

@henderkes henderkes merged commit 565ff27 into main Apr 12, 2026
7 checks passed
@henderkes henderkes deleted the feat/decimal branch April 12, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

php-decimal extension

2 participants