Skip to content

Added readonly reinitable helper - #22718

Merged
Girgias merged 3 commits into
php:masterfrom
NickSdot:readonly-reinitable-helper
Aug 7, 2026
Merged

Added readonly reinitable helper#22718
Girgias merged 3 commits into
php:masterfrom
NickSdot:readonly-reinitable-helper

Conversation

@NickSdot

Copy link
Copy Markdown
Contributor

Follow up to #22654 as discussed in #22588 (comment).

Added zend_object_set_properties_reinitable() to centralise temporarily allowing reinitialisation of initialised readonly properties during controlled operations such as cloning and unserialisation.

cc @TimWolla

@github-actions

Copy link
Copy Markdown

AWS x86_64 (c6id.metal)

Attribute Value
Environment aws
Instance type c6id.metal
Architecture x86_64
CPU Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz, 64 cores @ 2900 MHz
CPU settings disabled deeper C-states, disabled turbo boost, disabled hyper-threading
RAM 251 GB
Kernel 6.18.20-20.229.amzn2023.x86_64
OS Amazon Linux 2023.11.20260427
GCC 14.2.1
Time 2026-07-19 12:47:00 UTC
Job details https://github.com/php/php-src/actions/runs/29687603092 (Artifacts)
Changeset https://github.com/php/php-src/compare/3129b3baab..41991abf62

Laravel 12.11.0 demo app - 50 iterations, 50 warmups, 100 requests (sec)

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3129b3b 0.38958 0.39160 0.00038 0.10% 0.38999 0.00% 0.38991 0.00% 2.192 0.000 1.000 25.78 MB
PHP - baseline@3129b3b (JIT) 0.36355 0.36684 0.00088 0.24% 0.36455 -6.52% 0.36422 -6.59% 1.356 8.614 0.000 25.73 MB
PHP - readonly-reinitable-helper 0.39001 0.39162 0.00040 0.10% 0.39052 0.14% 0.39041 0.13% 1.175 -6.594 0.000 25.78 MB
PHP - readonly-reinitable-helper (JIT) 0.36336 0.36740 0.00095 0.26% 0.36468 -6.49% 0.36433 -6.56% 0.908 8.614 0.000 25.73 MB

Symfony 2.8.0 demo app - 50 iterations, 50 warmups, 100 requests (sec)

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3129b3b 0.67113 0.67315 0.00045 0.07% 0.67165 0.00% 0.67151 0.00% 1.792 0.000 1.000 25.75 MB
PHP - baseline@3129b3b (JIT) 0.64124 0.65052 0.00153 0.24% 0.64210 -4.40% 0.64165 -4.45% 4.318 8.614 0.000 26.20 MB
PHP - readonly-reinitable-helper 0.67079 0.67449 0.00059 0.09% 0.67163 -0.00% 0.67151 0.00% 2.728 0.531 0.596 26.14 MB
PHP - readonly-reinitable-helper (JIT) 0.64025 0.64479 0.00071 0.11% 0.64087 -4.58% 0.64072 -4.58% 3.823 8.614 0.000 26.20 MB

Wordpress 6.9 main page - 50 iterations, 20 warmups, 20 requests (sec)

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3129b3b 0.58768 0.59215 0.00065 0.11% 0.58823 0.00% 0.58811 0.00% 4.634 0.000 1.000 26.21 MB
PHP - baseline@3129b3b (JIT) 0.51871 0.52291 0.00113 0.22% 0.51980 -11.63% 0.51944 -11.68% 1.609 8.614 0.000 26.29 MB
PHP - readonly-reinitable-helper 0.58739 0.59227 0.00073 0.12% 0.58823 -0.00% 0.58810 -0.00% 3.830 0.489 0.625 26.16 MB
PHP - readonly-reinitable-helper (JIT) 0.51864 0.52319 0.00078 0.15% 0.51937 -11.71% 0.51923 -11.71% 3.373 8.614 0.000 26.29 MB

bench.php - 50 iterations, 20 warmups, 2 requests (sec)

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3129b3b 0.44963 0.45162 0.00052 0.12% 0.45069 0.00% 0.45074 0.00% -0.231 0.000 1.000 26.22 MB
PHP - baseline@3129b3b (JIT) 0.14419 0.14498 0.00017 0.11% 0.14461 -67.91% 0.14464 -67.91% -0.141 8.614 0.000 26.30 MB
PHP - readonly-reinitable-helper 0.44972 0.45338 0.00068 0.15% 0.45113 0.10% 0.45116 0.09% 0.509 -3.392 0.001 26.18 MB
PHP - readonly-reinitable-helper (JIT) 0.14426 0.14513 0.00021 0.15% 0.14466 -67.90% 0.14465 -67.91% 0.447 8.614 0.000 26.30 MB

@NickSdot
NickSdot force-pushed the readonly-reinitable-helper branch from 41991ab to c952aec Compare August 7, 2026 16:42

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this API need to be exposed? I'd prefer this to be static to reduce the API surface of the engine.

@NickSdot

NickSdot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Does this API need to be exposed?

Yes, because #22588 (RFC passed) is calling it from https://github.com/php/php-src/pull/22588/changes#diff-22314cb41b89cd823c95f1073b63956a80c293a1bb4bcc95d5b05d2388f75e3dR305

@Girgias
Girgias merged commit b704c6c into php:master Aug 7, 2026
18 checks passed
@NickSdot
NickSdot deleted the readonly-reinitable-helper branch August 7, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants