FAQ
Many interfaces work with callback functions, but they might work with
the generators, if there was a method Generator::__invoke($value).

I apologize if this topic has been discussed.
Thank.

Search Discussions

  • Niklas Keller at May 20, 2016 at 2:41 pm

    2016-05-20 15:34 GMT+02:00 S.A.N <ua.san.alex@gmail.com>:

    Many interfaces work with callback functions, but they might work with
    the generators, if there was a method Generator::__invoke($value).

    You can just use [$generator, "send"].
  • S.A.N at May 20, 2016 at 2:47 pm

    2016-05-20 17:41 GMT+03:00 Niklas Keller <me@kelunik.com>:
    2016-05-20 15:34 GMT+02:00 S.A.N <ua.san.alex@gmail.com>:
    Many interfaces work with callback functions, but they might work with
    the generators, if there was a method Generator::__invoke($value).

    You can just use [$generator, "send"].
    Yes, but it is slow and not nice :)
  • Niklas Keller at May 20, 2016 at 2:49 pm

    2016-05-20 16:47 GMT+02:00 S.A.N <ua.san.alex@gmail.com>:

    2016-05-20 17:41 GMT+03:00 Niklas Keller <me@kelunik.com>:
    2016-05-20 15:34 GMT+02:00 S.A.N <ua.san.alex@gmail.com>:
    Many interfaces work with callback functions, but they might work with
    the generators, if there was a method Generator::__invoke($value).

    You can just use [$generator, "send"].
    Yes, but it is slow and not nice :)
    I agree, but this is a general issue, nothing special to generators.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 20, '16 at 1:34p
activeMay 20, '16 at 2:49p
posts4
users2
websitephp.net

2 users in discussion

S.A.N: 2 posts Niklas Keller: 2 posts

People

Translate

site design / logo © 2018 Grokbase