GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Union types by nikic · Pull Request #4838 · php/php-src

Conversation

@nikic

@nikic nikic commented Oct 21, 2019

Copy link
Copy Markdown
Member

Implementation for union types RFC.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

carusogabriel, SammyK, theodorejb, adamwojs, matheusfaustino, sgolemon, kocsismate, TakTaki, michaljusiega, gedimin45, and 46 more reacted with hooray emoji bronek89, LeonardoSSev, fezfez, juniorb2ss, ska-ops, neoncitylights, ecreeth, carusogabriel, strongholdmedia, and eytienne reacted with heart emoji
All reactions
  • 🎉 56 reactions
  • ❤️ 10 reactions
@nikic nikic added the RFC label Oct 21, 2019
Ocramius
Ocramius approved these changes Oct 22, 2019
View reviewed changes

@Ocramius Ocramius left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Only had time to go through the tests: huge work, nice!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Bilge, someniatko, and honsa reacted with heart emoji
All reactions
  • ❤️ 3 reactions
Comment thread Zend/tests/type_declarations/union_types/class_loading.phpt Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nikic
nikic force-pushed the union-types branch 5 times, most recently from a68c5eb to 471931e Compare October 25, 2019 10:26
azjezz
azjezz approved these changes Oct 25, 2019
View reviewed changes

@azjezz azjezz left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Awesome work, thanks @nikic ❤️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nikic nikic mentioned this pull request Oct 28, 2019
Make zend_type into a struct with pointer + type_mask #4728
Closed
ammarfaizi2
ammarfaizi2 approved these changes Oct 31, 2019
View reviewed changes
nikic added 20 commits November 7, 2019 15:09
@nikic
Make zend_type a 2-field struct
0ac57d5
@nikic
Store pass_by_reference+is_variadic in type mask
8b62d66
@nikic
WIP Union types
4a9735f
@nikic
Fetch unresolved classes from autoload table
8f9c57f
@nikic
Fix coercion error
9c58da4
@nikic
Remove special exceptions when failing to resolve prop type class
48e3379
Instead throw the generic invalid type message. Otherwise we may
run into issues if a union type contains an invalid type, but also
a valid one.
@nikic
Fix the typed reference assignment logic
82cfa0c
This is tricky...
@nikic
Make loading in type errors robust
c786f78
@nikic
Add tests for redundant types
67c0d29
@nikic
Tweak error messages
af73a41
@nikic
Handle iterable + Traversable
4a8d0af
Not sure if all of this is really worthwhile, but we can still
drop it...
@nikic
Move test files
471c27f
@nikic
More tests
f681fb6
@nikic
Check for standalone null/false
20495e1
@nikic
Use smart_str for type error
291f52c
@nikic
Proper type error for union types
b49438b
I'm going with a canonical type format here -- and I think we should
move the rest towards this as well.
@nikic
Fix weak typing logic
887656d
@nikic
Cleanup MAY_BE_BOOL
24f863a
@nikic
Add weak typing tests
37b3997
@nikic
Support union types in AST printer
ccf57e9
nikic added 5 commits November 7, 2019 15:10
@nikic
Adjust test after property type loading changes
e7aecad
Class loading is no longer relevant here, so just test general
behavior.
@nikic
Add test for generator with multiple class return types
716cd38
@nikic
Add test for iterable+Traversable redundancy with extra class
7e7d240
@nikic
Add inheritance test and fix some related issues
6abe540
@nikic
Fixup reflection after rebase
59802bb
@nikic
nikic force-pushed the union-types branch from 471931e to 59802bb Compare November 7, 2019 14:23
nikic added 11 commits November 8, 2019 11:27
@nikic
Revert "Run coverage job"
f85a717
This reverts commit 476adfa.
@nikic
Add json skipifs
c06e6c9
@nikic
Extra variance test
956d3a3
@nikic
Fix issues related to inheritance of internal union types
8bb01a8
@nikic
Properly destroy internal property types
3a9ff5d
@nikic
Fix missing cache slot increment
edcd6d9
@nikic
Use goto for common code-paths
b036ffa
@nikic
Add test for iterable variance
ccbd868
@nikic
Fix accidental whitespace change
54f9bd4
@nikic
Apply cache slot fix to jit as well
c443f3b
@nikic
Fix file cache
b1615d1
@php-pulls php-pulls closed this in 999e32b Nov 8, 2019
@carusogabriel carusogabriel mentioned this pull request Mar 28, 2020
[RFC] Ensure correct magic methods' signatures when typed #4177
Closed
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 29, 2020
@strongholdmedia

strongholdmedia commented Jul 8, 2020

Copy link
Copy Markdown
Contributor

My only question in retrospect is why wait for PHP 8?
I mean, @nikic stated no backwards-incompatible changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azjezz

azjezz commented Jul 8, 2020

Copy link
Copy Markdown
Contributor

@strongholdmedia because 7.4 went feature freez around a year ago 😄 ( https://externals.io/message/106249 )

strongholdmedia reacted with thumbs up emoji strongholdmedia reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@strongholdmedia

strongholdmedia commented Jul 8, 2020

Copy link
Copy Markdown
Contributor

Sure, I do know that. :)
I suppose that means there will be no PHP 7.5 then.
Thanks for the implicit heads up. :)

azjezz reacted with thumbs up emoji azjezz reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azjezz

azjezz commented Jul 8, 2020

Copy link
Copy Markdown
Contributor

Yes, there's no 7.5 :)

strongholdmedia reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@strongholdmedia

strongholdmedia commented Jul 8, 2020

Copy link
Copy Markdown
Contributor

The uttermost shame is that I am long since subscribed to the internals list, but I couldn't get myself to wade through the nonsense of the attached .eml forest that is a PITA to view :/

Perhaps it is just time to switch to the regular format from the digest stuff.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request Dec 25, 2022
@jrfnl
PHP 8.0 | NewParamTypeDeclarations: add support for union types [2]
fa6b46f
> Union Types
>
> Support for union types has been added.

Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported.

Ref:
* https://wiki.php.net/rfc/union_types_v2
* https://www.php.net/manual/en/migration80.new-features.php#migration80.new-features.core.union-types
* https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union
* php/php-src#4838
* php/php-src@999e32b
jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request Dec 25, 2022
@jrfnl
PHP 8.0 | NewReturnTypeDeclarations: add support for union types [2]
1e62b8a
> Union Types
>
> Support for union types has been added.

Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported.

Ref:
* https://wiki.php.net/rfc/union_types_v2
* https://www.php.net/manual/en/migration80.new-features.php#migration80.new-features.core.union-types
* https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union
* php/php-src#4838
* php/php-src@999e32b
jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request Dec 25, 2022
@jrfnl
PHP 8.0 | NewTypedProperties: add support for union types [2]
2a95530
> Union Types
>
> Support for union types has been added.

Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported.

Ref:
* https://wiki.php.net/rfc/union_types_v2
* https://www.php.net/manual/en/migration80.new-features.php#migration80.new-features.core.union-types
* https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union
* php/php-src#4838
* php/php-src@999e32b
@jrfnl jrfnl mentioned this pull request Dec 25, 2022
PHP 8.0 | Add support for and detection of union types in param, return and property types PHPCompatibility/PHPCompatibility#1444
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers
@Ocramius Ocramius Ocramius approved these changes
@ammarfaizi2 ammarfaizi2 ammarfaizi2 approved these changes
@azjezz azjezz azjezz approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

RFC

Projects

None yet

Milestone

PHP 8.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@nikic @strongholdmedia @azjezz @Ocramius @ammarfaizi2 @carusogabriel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.