Skip to content

Conversation

mrclay
Copy link
Owner

@mrclay mrclay commented Feb 10, 2020

This implementation parses a new callback syntax into an AST representing the traditional array/string callback AST.

  • fn::Foo::method emits [Foo::class,'method'] - PASS!
  • fn::\Foo::method emits [\Foo::class,'method'] - PASS!
  • fn::$foo::method emits [$foo,'method'] - PASS!
  • fn::intval emits "intval". Here a naive implementation just converts the name into a string without proper name resolution. This would need handling like ZEND_AST_CLASS_NAME, which can compile to an operation to resolve the name at runtime. Maybe the plumbing is present in zend_compile_ns_call but a new function would need to emit an IS_CONST op instead of ZEND_INIT_NS_FCALL_BY_NAME.

This implementation parses a new callback syntax into an AST representing the traditional array/string callback AST.

* `fn::Foo::method` emits `[Foo::class,'method']` - PASS!
* `fn::\Foo::method` emits `[\Foo::class,'method']` - PASS!
* `fn::$foo::method` emits `[$foo,'method']` - PASS!
* `fn::intval` emits `"intval"`. Works for global functions.
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.

1 participant