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 — [RFC] Partial Function Application by krakjoe · Pull Request #6898 · php/php-src

Conversation

@krakjoe

@krakjoe krakjoe commented Apr 22, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Implementation for https://wiki.php.net/rfc/partial_function_application

Sorry, something went wrong.

Uh oh!

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

Crell, KennedyTedesco, azjezz, rentalhost, Dragomeat, klimick, jakobkolb, root-aza, vudaltsov, someniatko, and 23 more reacted with thumbs up emoji myForksFiles, zlianon, mvorisek, and ging-dev reacted with thumbs down emoji francislavoie, azjezz, byanelli, faizanakram99, mikield, and omgmashina reacted with hooray emoji azjezz, sirsnyder, KennedyTedesco, rentalhost, jakobkolb, Crell, Dragomeat, klimick, root-aza, vudaltsov, and 17 more reacted with heart emoji francislavoie, ziaratban, azjezz, byanelli, faizanakram99, mikield, omgmashina, and alexpts reacted with rocket emoji
All reactions
  • 👍 33 reactions
  • 👎 4 reactions
  • 🎉 6 reactions
  • ❤️ 27 reactions
  • 🚀 8 reactions
@krakjoe krakjoe added the RFC label Apr 22, 2021
azjezz
azjezz reviewed Apr 22, 2021
View reviewed changes
Comment thread Zend/zend_partial.stub.php Resolved

Uh oh!

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

@krakjoe krakjoe closed this Apr 24, 2021
@krakjoe krakjoe reopened this Apr 24, 2021
@krakjoe krakjoe closed this Apr 26, 2021
@krakjoe krakjoe reopened this Apr 26, 2021
@azjezz azjezz mentioned this pull request Apr 26, 2021
support generic variables vimeo/psalm#3963
Closed
@krakjoe
krakjoe force-pushed the partials branch from b6a3638 to a75987f Compare April 26, 2021 16:51
krakjoe
krakjoe commented Apr 30, 2021
View reviewed changes
Comment thread Zend/Optimizer/zend_call_graph.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.h Resolved

Uh oh!

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

Comment thread Zend/zend_object_handlers.h Resolved

Uh oh!

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

Comment thread Zend/zend_opcode.c Resolved

Uh oh!

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

Comment thread Zend/zend_vm_def.h Resolved

Uh oh!

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

Comment thread ext/reflection/php_reflection.c Resolved

Uh oh!

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

Comment thread ext/reflection/php_reflection.c Resolved

Uh oh!

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

Comment thread ext/reflection/php_reflection.c Resolved

Uh oh!

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

Comment thread ext/reflection/tests/ReflectionExtension_getClasses_basic.phpt Resolved

Uh oh!

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

@krakjoe
krakjoe force-pushed the partials branch from a00d67a to a11b43e Compare May 11, 2021 01:52
@nikic

nikic commented May 12, 2021

Copy link
Copy Markdown
Member

I'm missing a test for __call/__callStatic trampolines.

All reactions

Sorry, something went wrong.

Uh oh!

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

nikic
nikic reviewed May 12, 2021
View reviewed changes
Comment thread Zend/tests/partial_function/nested.phpt Resolved

Uh oh!

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

Comment thread Zend/tests/partial_function/object.phpt Resolved

Uh oh!

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

Comment thread Zend/tests/partial_function/reflection.phpt Resolved

Uh oh!

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

Comment thread Zend/tests/partial_function/type-check.phpt Resolved

Uh oh!

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

Comment thread Zend/tests/partial_function/variadics-named-nested-overwrite.phpt Resolved

Uh oh!

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

dkulyk
dkulyk reviewed May 13, 2021
View reviewed changes
Comment thread Zend/tests/partial_function/named-args.phpt Resolved

Uh oh!

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

nicolas-grekas
nicolas-grekas reviewed May 13, 2021
View reviewed changes
Comment thread Zend/tests/partial_function/reflection-resolver.phpt Resolved

Uh oh!

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

POPSuL
POPSuL reviewed May 13, 2021
View reviewed changes
Comment thread Zend/tests/partial_function/object-constructor.phpt Resolved

Uh oh!

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

@krakjoe
krakjoe force-pushed the partials branch from 17ba8a6 to a85b760 Compare May 14, 2021 10:34
nikic
nikic reviewed May 14, 2021
View reviewed changes
Comment thread Zend/zend_ast.h Resolved

Uh oh!

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

Comment thread Zend/tests/partial_function/type-check.phpt Resolved

Uh oh!

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

Comment thread Zend/zend_closures.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

nikic
nikic reviewed May 14, 2021
View reviewed changes
Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread Zend/zend_compile.c Resolved

Uh oh!

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

Comment thread ext/reflection/php_reflection.c Resolved

Uh oh!

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

Comment thread Zend/zend_vm_def.h Resolved

Uh oh!

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

Comment thread Zend/zend_vm_def.h Resolved

Uh oh!

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

Comment thread Zend/zend_vm_def.h Resolved

Uh oh!

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

Comment thread Zend/zend_vm_def.h Resolved

Uh oh!

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

nikic
nikic reviewed May 14, 2021
View reviewed changes
Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_vm_def.h Resolved

Uh oh!

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

nikic
nikic reviewed May 14, 2021
View reviewed changes
Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Outdated

@nikic nikic May 14, 2021

Copy link
Copy Markdown
Member

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.

So for the new Foo(?) case, we first create an object, then destroy it and then if the partial is invoked, create another object.

This is non-great, though I'm not sure just how non-great it is. In conjunction with https://wiki.php.net/rfc/new_in_initializers it could mean that property default values get instantiated and immediately dropped again (though arguably that's an issue with that RFC).

Sorry, something went wrong.

Uh oh!

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

All reactions

@krakjoe krakjoe May 14, 2021

Copy link
Copy Markdown
Member Author

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.

If we have space for a flag, we could use IS_OBJ_CONSTRUCTOR_CALLED here and use the initial object ...

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

@krakjoe
krakjoe force-pushed the partials branch from 54d8c55 to 9c67617 Compare May 15, 2021 13:00
@krakjoe krakjoe closed this May 19, 2021
@krakjoe krakjoe reopened this May 28, 2021
@krakjoe
krakjoe marked this pull request as draft May 28, 2021 08:52
@krakjoe
krakjoe force-pushed the partials branch 2 times, most recently from d264f87 to 61e7f1e Compare May 29, 2021 16:24
@krakjoe
krakjoe marked this pull request as ready for review May 29, 2021 16:58
@krakjoe
krakjoe force-pushed the partials branch 3 times, most recently from 11123b8 to 286e16f Compare May 29, 2021 20:55
krakjoe added 2 commits June 17, 2021 18:25
@krakjoe
comments
88aa29c
@krakjoe
drop silly macro
81b64ff
@nikic

This comment has been minimized.

Sign in to view
@krakjoe
fix another gc issue
67c3b66
@krakjoe

This comment has been minimized.

Sign in to view
@krakjoe
fix uaf in unfinished calls, fix leak args
3f8a12a
nikic
nikic reviewed Jun 18, 2021
View reviewed changes
Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

Comment thread Zend/zend_partial.c Resolved

Uh oh!

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

@krakjoe

This comment has been minimized.

Sign in to view
krakjoe added 3 commits June 18, 2021 17:18
@krakjoe
put assert back
bde700f
@krakjoe
fix indent, repeat type
b699d65
@krakjoe
use hash add variants
0e8a0a0
@nikic

This comment has been minimized.

Sign in to view
krakjoe added 3 commits June 18, 2021 17:29
@krakjoe
insert null in debug info
711b33a
@krakjoe
drop sprintf for zend_string_init
9400a69
@krakjoe
fix uaf, order of destruction
583264d
@krakjoe

This comment has been minimized.

Sign in to view
@krakjoe
set ce ptr
6afa0d1
@nikic

This comment has been minimized.

Sign in to view
@krakjoe
fix null ptr deref
12d6006
@krakjoe

This comment has been minimized.

Sign in to view
@krakjoe
fix wrong signature check
fd62047
@krakjoe

This comment has been minimized.

Sign in to view
patrickallaert
patrickallaert reviewed Jun 19, 2021
View reviewed changes
Comment thread ext/reflection/php_reflection.c
Comment on lines +1326 to +1328
}
ZEND_ASSERT(0);
return -1;

@patrickallaert patrickallaert Jun 19, 2021

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.

Indentation: mix of tabs and spaces.

Sorry, something went wrong.

Uh oh!

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

All reactions
@thekid thekid mentioned this pull request Jun 27, 2021
Implement partial function application xp-framework/compiler#113
Closed
@faizanakram99

faizanakram99 commented Jul 1, 2021

Copy link
Copy Markdown

We lost :(

someniatko, innocenzi, ddziaduch, root-aza, meszaros-lajos-gyorgy, verfriemelt-dot-org, jurchiks, mhitza, kasumikagari, Dewdrops, and 6 more reacted with confused emoji
All reactions
  • 😕 16 reactions

Sorry, something went wrong.

Uh oh!

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

@krakjoe krakjoe closed this Jul 1, 2021
@POPSuL

POPSuL commented Jul 1, 2021

Copy link
Copy Markdown

What's next? Will there be an alternative from Nikita, or your collaboration?

All reactions

Sorry, something went wrong.

Uh oh!

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

@nikic nikic mentioned this pull request Jul 13, 2021
Partial function application #5547
Closed
@jurchiks

jurchiks commented Feb 25, 2022

Copy link
Copy Markdown

Damn shame, it looks to me like a very useful feature to have.

zmitic, Dewdrops, x0s, tianyiw2013, CViniciusSDias, zejji, epic-64, rvanlaak, gnutix, and jorbascrumps reacted with thumbs up emoji
All reactions
  • 👍 10 reactions

Sorry, something went wrong.

Uh oh!

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

@arnaud-lb arnaud-lb mentioned this pull request Jun 20, 2025
Partials v2 arnaud-lb/php-src#12
Draft
7 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kamil-tekiela kamil-tekiela kamil-tekiela left review comments
+10 more reviewers
@patrickallaert patrickallaert patrickallaert left review comments
@drealecs drealecs drealecs left review comments
@nikic nikic nikic left review comments
@nicolas-grekas nicolas-grekas nicolas-grekas left review comments
@Crell Crell Crell left review comments
@dkulyk dkulyk dkulyk left review comments
@POPSuL POPSuL POPSuL left review comments
@francislavoie francislavoie francislavoie left review comments
@someniatko someniatko someniatko left review comments
@azjezz azjezz azjezz left review comments
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

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

14 participants

@krakjoe @nikic @faizanakram99 @POPSuL @jurchiks @patrickallaert @drealecs @nicolas-grekas @Crell @dkulyk @francislavoie @kamil-tekiela @someniatko @azjezz
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.