Skip to content

Zend: refactor type checking and unify const, prop, arg, and return values#21580

Draft
Girgias wants to merge 6 commits intophp:masterfrom
Girgias:2026-03-type-checking-merge
Draft

Zend: refactor type checking and unify const, prop, arg, and return values#21580
Girgias wants to merge 6 commits intophp:masterfrom
Girgias:2026-03-type-checking-merge

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Mar 30, 2026

W.I.P. this is an attempt to unify the type checking logic so that class properties and constants use the same routines as arguments and return values for functions.

Pre-requisites:

  • Implement Stringable on GMP object
  • Implement Stringable on ext/com variant object

@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.12.66-88.122.amzn2023.x86_64
OS Amazon Linux 2023.10.20260202
GCC 14.2.1
Time 2026-03-30 22:26:55 UTC
Job details https://github.com/php/php-src/actions/runs/23770742851 (Artifacts)
Changeset https://github.com/php/php-src/compare/cd753007ce..79c7881b97

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@cd75300 0.38938 0.39099 0.00029 0.07% 0.38982 0.00% 0.38977 0.00% 1.520 0.000 1.000 25.17 MB
PHP - 2026-03-type-checking-merge 0.38925 0.39058 0.00033 0.09% 0.38988 0.02% 0.38986 0.02% 0.114 -1.282 0.200 25.21 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@cd75300 0.66347 0.66543 0.00043 0.07% 0.66394 0.00% 0.66380 0.00% 2.003 0.000 1.000 25.19 MB
PHP - 2026-03-type-checking-merge 0.66705 0.66905 0.00043 0.06% 0.66755 0.54% 0.66743 0.55% 1.723 -8.614 0.000 25.24 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@cd75300 0.58429 0.58789 0.00092 0.16% 0.58517 0.00% 0.58488 0.00% 1.932 0.000 1.000 25.26 MB
PHP - 2026-03-type-checking-merge 0.58642 0.59025 0.00077 0.13% 0.58716 0.34% 0.58691 0.35% 2.602 -7.170 0.000 25.24 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@cd75300 0.44384 0.44610 0.00061 0.14% 0.44513 0.00% 0.44530 0.00% -0.284 0.000 1.000 25.26 MB
PHP - 2026-03-type-checking-merge 0.44379 0.44682 0.00071 0.16% 0.44486 -0.06% 0.44479 -0.12% 0.591 2.227 0.026 25.24 MB

@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.12.66-88.122.amzn2023.x86_64
OS Amazon Linux 2023.10.20260202
GCC 14.2.1
Time 2026-03-31 00:20:04 UTC
Job details https://github.com/php/php-src/actions/runs/23774219829 (Artifacts)
Changeset https://github.com/php/php-src/compare/cd753007ce..5d77206a6f

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@cd75300 0.38939 0.39137 0.00039 0.10% 0.38977 0.00% 0.38967 0.00% 2.504 0.000 1.000 25.18 MB
PHP - 2026-03-type-checking-merge 0.38896 0.39100 0.00043 0.11% 0.38957 -0.05% 0.38943 -0.06% 1.711 3.767 0.000 25.22 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@cd75300 0.66274 0.67079 0.00128 0.19% 0.66350 0.00% 0.66327 0.00% 4.819 0.000 1.000 25.20 MB
PHP - 2026-03-type-checking-merge 0.66877 0.67265 0.00100 0.15% 0.66959 0.92% 0.66919 0.89% 1.852 -8.317 0.000 25.25 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@cd75300 0.58419 0.58853 0.00066 0.11% 0.58491 0.00% 0.58470 0.00% 3.548 0.000 1.000 25.27 MB
PHP - 2026-03-type-checking-merge 0.58682 0.59020 0.00081 0.14% 0.58761 0.46% 0.58741 0.46% 2.223 -8.310 0.000 25.19 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@cd75300 0.44256 0.44697 0.00088 0.20% 0.44511 0.00% 0.44521 0.00% -0.444 0.000 1.000 25.27 MB
PHP - 2026-03-type-checking-merge 0.44346 0.44591 0.00057 0.13% 0.44464 -0.11% 0.44453 -0.15% 0.267 3.285 0.001 25.19 MB

@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.12.66-88.122.amzn2023.x86_64
OS Amazon Linux 2023.10.20260202
GCC 14.2.1
Time 2026-03-31 12:04:13 UTC
Job details https://github.com/php/php-src/actions/runs/23796277304 (Artifacts)
Changeset https://github.com/php/php-src/compare/cd753007ce..fe9560a793

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@cd75300 0.38945 0.39035 0.00024 0.06% 0.38987 0.00% 0.38985 0.00% 0.336 0.000 1.000 25.17 MB
PHP - 2026-03-type-checking-merge 0.38899 0.39043 0.00031 0.08% 0.38954 -0.08% 0.38946 -0.10% 1.057 5.587 0.000 25.21 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@cd75300 0.66295 0.66724 0.00063 0.10% 0.66360 0.00% 0.66343 0.00% 4.069 0.000 1.000 25.19 MB
PHP - 2026-03-type-checking-merge 0.66854 0.67412 0.00136 0.20% 0.66943 0.88% 0.66893 0.83% 2.443 -8.614 0.000 25.24 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@cd75300 0.58445 0.59252 0.00138 0.24% 0.58525 0.00% 0.58480 0.00% 3.642 0.000 1.000 25.21 MB
PHP - 2026-03-type-checking-merge 0.58691 0.59509 0.00119 0.20% 0.58754 0.39% 0.58723 0.42% 5.601 -7.166 0.000 25.20 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@cd75300 0.44371 0.44634 0.00058 0.13% 0.44503 0.00% 0.44503 0.00% 0.044 0.000 1.000 25.21 MB
PHP - 2026-03-type-checking-merge 0.44340 0.44599 0.00055 0.12% 0.44455 -0.11% 0.44451 -0.12% 0.375 3.974 0.000 25.20 MB

@Girgias Girgias force-pushed the 2026-03-type-checking-merge branch from fe9560a to 79c99b4 Compare March 31, 2026 19:42
@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.12.66-88.122.amzn2023.x86_64
OS Amazon Linux 2023.10.20260202
GCC 14.2.1
Time 2026-03-31 19:43:57 UTC
Job details https://github.com/php/php-src/actions/runs/23816125622 (Artifacts)
Changeset https://github.com/php/php-src/compare/a231da8d28..79c99b40e7

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@a231da8 0.38895 0.39071 0.00034 0.09% 0.38967 0.00% 0.38967 0.00% 0.575 0.000 1.000 25.18 MB
PHP - 2026-03-type-checking-merge 0.38779 0.38987 0.00049 0.13% 0.38839 -0.33% 0.38829 -0.35% 1.489 7.880 0.000 25.28 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@a231da8 0.66453 0.66802 0.00057 0.09% 0.66515 0.00% 0.66499 0.00% 2.851 0.000 1.000 25.20 MB
PHP - 2026-03-type-checking-merge 0.67153 0.68003 0.00128 0.19% 0.67251 1.11% 0.67215 1.08% 4.492 -8.614 0.000 25.19 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@a231da8 0.58494 0.58919 0.00087 0.15% 0.58569 0.00% 0.58541 0.00% 2.891 0.000 1.000 25.22 MB
PHP - 2026-03-type-checking-merge 0.58561 0.58986 0.00096 0.16% 0.58673 0.18% 0.58645 0.18% 2.209 -7.014 0.000 25.21 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@a231da8 0.44323 0.44780 0.00077 0.17% 0.44529 0.00% 0.44526 0.00% 0.414 0.000 1.000 25.22 MB
PHP - 2026-03-type-checking-merge 0.44341 0.44650 0.00067 0.15% 0.44474 -0.12% 0.44471 -0.12% 0.680 3.909 0.000 25.21 MB

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.

2 participants