Skip to content

[RFC] Support object types in BCMath #13741

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

Merged
merged 63 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
cde6a44
Support object types in BCMath
SakiTakamachi Aug 27, 2024
34f764e
Added operator tests
SakiTakamachi Aug 27, 2024
2dc417f
Added basic tests
SakiTakamachi Aug 27, 2024
7c8eb0d
Fixed result scale and zero
SakiTakamachi Aug 28, 2024
3f73943
Added method tests
SakiTakamachi Aug 28, 2024
5b3bc40
Fixed test expected
SakiTakamachi Aug 28, 2024
d72ab4d
revert force push
SakiTakamachi Aug 29, 2024
91fb82a
Fixed stub
SakiTakamachi Aug 29, 2024
7816fd3
Address comments
SakiTakamachi Aug 29, 2024
fffbee9
Fixed bcmath_number_get_properties_for
SakiTakamachi Aug 29, 2024
b0e600c
Added unset handler
SakiTakamachi Aug 29, 2024
f61973f
Fixed and rename bcmath_number_isset_property
SakiTakamachi Aug 29, 2024
4813ece
Added a comment about exponent
SakiTakamachi Aug 29, 2024
d7337e7
Added a comment about scale or rscale
SakiTakamachi Aug 29, 2024
c81d947
Removed unnecessary bc_free_num()
SakiTakamachi Aug 29, 2024
9a3d2e1
use Z_PARAM_ARRAY_HT
SakiTakamachi Aug 29, 2024
5bac466
Increased constructor test cases and divided them into 32bit and 64bit
SakiTakamachi Aug 29, 2024
c8ab961
Fixed bc_long2num
SakiTakamachi Aug 29, 2024
419d6cf
Fixed cast and construct tests
SakiTakamachi Aug 29, 2024
d9d839d
Fixed tests
SakiTakamachi Aug 29, 2024
0f3e489
Added BCMATH_PARSE_ / BCMATH_PARAM_ macros
SakiTakamachi Aug 29, 2024
209824d
Fixed bc_long2num
SakiTakamachi Aug 29, 2024
583cc82
Fixed test
SakiTakamachi Aug 29, 2024
67e943a
Added clone test
SakiTakamachi Aug 29, 2024
c233cde
Added bc_free_num()
SakiTakamachi Aug 29, 2024
5043d8a
Fixed bc_long2num
SakiTakamachi Aug 29, 2024
b45b6dc
Fixed bc_free_num
SakiTakamachi Aug 29, 2024
278a95b
Change lval == LONG_MIN to lval <= LONG_MIN
SakiTakamachi Aug 30, 2024
672509e
Added test cases
SakiTakamachi Aug 30, 2024
6d32f7d
Fixed long2num
SakiTakamachi Aug 30, 2024
b8ca45d
Added brackets to macro
SakiTakamachi Aug 31, 2024
4184e86
Moved forward declarations to the top
SakiTakamachi Aug 31, 2024
541cea7
Removed ZEND_PROP_PURPOSE_GET_OBJECT_VARS check
SakiTakamachi Aug 31, 2024
99e784a
Removed ZEND_PARSE_PARAMS_QUIET check
SakiTakamachi Aug 31, 2024
09d1b77
Fixed int to bcmath_compare_result
SakiTakamachi Aug 31, 2024
a6c6112
Removed zend_always_inline from bcmath_number_parse_num and bc_num_fr…
SakiTakamachi Aug 31, 2024
6c8a6c4
Removed modulus_num != NULL check
SakiTakamachi Aug 31, 2024
28a7c26
Remove unnecessary arguments
SakiTakamachi Aug 31, 2024
1ccbc83
Fixed param names of bcmath_number_compare
SakiTakamachi Aug 31, 2024
c868ce0
Fixed test name short syntax to compound assignment
SakiTakamachi Aug 31, 2024
2cb32d5
Added $num_old value to expected value of test
SakiTakamachi Aug 31, 2024
e0fa33d
Fixed Error to Exception
SakiTakamachi Aug 31, 2024
84d2b04
Fixed to issue an error if the result scale exceeds INT_MAX.
SakiTakamachi Aug 31, 2024
ca65b85
Fixed the processing when op1 and ret are the same in do_operation.
SakiTakamachi Aug 31, 2024
21bf9a8
Moved null check in do_operation to bcmath_number_parse_num
SakiTakamachi Aug 31, 2024
f7a1834
Fixed the behavior when construct/unserialize is executed multiple ti…
SakiTakamachi Aug 31, 2024
a0ec786
unserialize does not allow empty strings
SakiTakamachi Aug 31, 2024
55c4e50
use ZEND_STRL
SakiTakamachi Aug 31, 2024
f185841
Considering the 32-bit environment regarding the overflow of the resu…
SakiTakamachi Aug 31, 2024
9892fb5
Deduplication of ZVAL_OBJ(ret_val, &intern->std)
SakiTakamachi Aug 31, 2024
d179378
Removed bc_num_from_xxx wrapper
SakiTakamachi Sep 1, 2024
4e92c96
Removed null check from bcmath_number_compare
SakiTakamachi Sep 1, 2024
ade0929
Explicitly cast the return value of bcmath_number_compare to int
SakiTakamachi Sep 1, 2024
de3e83b
Set the initial value of zend_long
SakiTakamachi Sep 1, 2024
ab641de
Delete unnecessary bc_free_num when calculation fails
SakiTakamachi Sep 1, 2024
796dc70
Added null check for "full_scale"
SakiTakamachi Sep 2, 2024
a9855a1
Fixed BCMATH_PARAM / PARSE macros
SakiTakamachi Sep 2, 2024
6538831
Fixed zend_hash_str_update to zend_hash_update
SakiTakamachi Sep 4, 2024
486ede4
Fixed zend_hash_str_update to zend_hash_update
SakiTakamachi Sep 4, 2024
dee6a44
Fixed zend_string_equals_literal to zend_string_equals
SakiTakamachi Sep 4, 2024
ce2edc1
Removed zend_always_inline
SakiTakamachi Sep 4, 2024
0afc106
Fixed zend_hash_str_find to zend_hash_find
SakiTakamachi Sep 4, 2024
d8b1313
[skip ci] NEWS/UPGRADING
SakiTakamachi Sep 4, 2024
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
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PHP NEWS
- BCMath:
. Fixed LONG_MAX in BCMath ext. (Saki Takamachi)
. Fixed bcdiv() div by one. (Saki Takamachi)
. [RFC] Support object types in BCMath. (Saki Takamachi)

- Core:
. Fixed bug GH-15330 (Do not scan generator frames more than once). (Arnaud)
Expand Down
9 changes: 9 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,15 @@ PHP 8.4 UPGRADE NOTES
7. New Classes and Interfaces
========================================

- BCMath:
. Added BcMath\Number class. It is an immutable object, has methods that are
equivalent to existing BCMath calculation functions, and can also be calculated
using operators.
The existing BCMath function returned a string for each calculation, but this
class returns an object.
RFC: https://wiki.php.net/rfc/support_object_type_in_bcmath,
https://wiki.php.net/rfc/fix_up_bcmath_number_class

- Core:
. New RequestParseBodyException.
RFC: https://wiki.php.net/rfc/rfc1867-non-post
Expand Down
Loading