Skip to content

Comments

Add cast kinds for bool, int, string#1098

Merged
nikic merged 1 commit intonikic:masterfrom
mttsch:feature/cast_kinds
Aug 6, 2025
Merged

Add cast kinds for bool, int, string#1098
nikic merged 1 commit intonikic:masterfrom
mttsch:feature/cast_kinds

Conversation

@mttsch
Copy link
Contributor

@mttsch mttsch commented Aug 6, 2025

No description provided.

$binary = (binary) $binary;
-----
$int = (int) $int;
$integer = (int) $integer;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the previous behavior that converts the aliased casts to their un-alised casts for backward compatibility while writing. This is in contrast to double-like casts, where pExpr_Cast_Double() considers the original kind.

@nikic
Copy link
Owner

nikic commented Aug 6, 2025

This is to detect deprecated cast kinds?

@mttsch
Copy link
Contributor Author

mttsch commented Aug 6, 2025

@nikic Yes, exactly.

@nikic nikic merged commit 5ad295a into nikic:master Aug 6, 2025
9 of 10 checks passed
@mttsch mttsch deleted the feature/cast_kinds branch August 6, 2025 19:45
@staabm
Copy link
Contributor

staabm commented Aug 13, 2025

@mttsch could you check whether this PR broke the PHP8.5 unit tests (see latest master commit which added PHP8.5 coverage after this PR)?

@mttsch
Copy link
Contributor Author

mttsch commented Aug 13, 2025

@staabm The issue does not exist for the tagged alpha4 version:

root@f056498d2af3:/var/www/html# php -v
PHP 8.5.0alpha4 (cli) (built: Aug 13 2025 03:24:10) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0alpha4, Copyright (c), by Zend Technologies
root@f056498d2af3:/var/www/html# ./vendor/bin/phpunit 
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

.............................................................   61 / 1874 (  3%)
[…]
............................................                  1874 / 1874 (100%)

Time: 00:00.530, Memory: 44.00 MB

OK (1874 tests, 2747 assertions)

I am not sure if I want to/can spend the time to set up a PHP setup/container with the latest commit (or same commit as in CI) from the php-src at the moment.

PS: … I will try setting it up this evening if time permits.

@nikic
Copy link
Owner

nikic commented Aug 13, 2025

That was due to a php-src bug that I already fixed in php/php-src#19438.

@staabm
Copy link
Contributor

staabm commented Aug 13, 2025

awesome thanks for the feedback

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.

3 participants