GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Annika Backstrom (annika@xoxo.zone)'s status on Monday, 12-Feb-2024 22:46:50 JST Annika Backstrom Annika Backstrom

    > iterator_to_array(new InfiniteIterator(new ArrayIterator([1])));

    #PHP

    In conversation about a year ago from xoxo.zone permalink
    • Embed this notice
      Annika Backstrom (annika@xoxo.zone)'s status on Monday, 12-Feb-2024 22:47:43 JST Annika Backstrom Annika Backstrom
      in reply to

      seriously though, i just want to pass an additional argument to my array_map() callback

      In conversation about a year ago permalink
    • Embed this notice
      Annika Backstrom (annika@xoxo.zone)'s status on Monday, 12-Feb-2024 22:49:39 JST Annika Backstrom Annika Backstrom
      in reply to
      • Dominik

      @chrastecky my way is more fun!

      In conversation about a year ago permalink
    • Embed this notice
      Dominik (chrastecky@phpc.social)'s status on Monday, 12-Feb-2024 22:49:40 JST Dominik Dominik
      in reply to

      @annika That's a long way to write

      > while(true) {}

      In conversation about a year ago permalink
    • Embed this notice
      Annika Backstrom (annika@xoxo.zone)'s status on Tuesday, 13-Feb-2024 03:30:28 JST Annika Backstrom Annika Backstrom
      in reply to
      • Anthony

      @stormsweeper yeah i would assume that's pretty efficient given copy-on-write. `array_fill(0, count($arr), $my_argument)`

      In conversation about a year ago permalink
    • Embed this notice
      Anthony (stormsweeper@dice.camp)'s status on Tuesday, 13-Feb-2024 03:30:29 JST Anthony Anthony
      in reply to

      @annika you can pass multiple arrays if you can make one of the same length

      In conversation about a year ago permalink
    • Embed this notice
      Anthony (stormsweeper@dice.camp)'s status on Tuesday, 13-Feb-2024 04:31:25 JST Anthony Anthony
      in reply to

      @annika oh if it's just the same var for all invocations you can use `use`: `function($foo) use ($someVar) {}` https://www.php.net/manual/en/functions.anonymous.php#example-541
      (this `use` not to be confused with the other uses of `use` 🙃)

      In conversation about a year ago permalink
    • Embed this notice
      Annika Backstrom (annika@xoxo.zone)'s status on Tuesday, 13-Feb-2024 04:31:53 JST Annika Backstrom Annika Backstrom
      in reply to
      • Anthony

      @stormsweeper In the end I used an arrow function, it's just a shame to break the terseness of the first-class callable syntax `foo(...)`

      In conversation about a year ago permalink
    • Embed this notice
      Annika Backstrom (annika@xoxo.zone)'s status on Tuesday, 13-Feb-2024 05:13:42 JST Annika Backstrom Annika Backstrom
      in reply to
      • Anthony

      @stormsweeper It's truuuue, honestly I use Itertools most of the time for a pleasing one-liner 😅

      In conversation about a year ago permalink
    • Embed this notice
      Anthony (stormsweeper@dice.camp)'s status on Tuesday, 13-Feb-2024 05:13:44 JST Anthony Anthony
      in reply to

      @annika I also feel morally obligated to recommend the use for foreach for complex cases 😎

      In conversation about a year ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.