To lighten up some discussion here, I would like to ask what features or changes you would love to see in future PHP versions? We know that in recent versions a lot of nice adjustments were added, but I bet most of us dreams for more.

I personally would love to see types on inline variables, at first even not strict. However, I don’t know if it’s remotely possible with how currently the language is implemented.

  • blackshadev@programming.dev
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 year ago

    Proper typing of nested or generic types. For instance: generic classes or array elements without phpdoc’s template.

    For me the typing of array elements is the most important one. As soon as you have some form of array, the typing in php ends. I see this as such a short coming in the growing type system of php. Seeing a lonely array type always leaves me questioning simple things like: What kind of array is it, a list of strings, objects? Or maybe an associative array? Does it even hold items? Why are we here?

    • prwnr@programming.devOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Ah right. that would be definitely great too.

      Maybe this could go in steps or simply as some new structure like a map. I would love to see map-like structure in PHP like there is in Go

      • spartanatreyu@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Mainly because you’ve got to setup PHP to be debuggable in the first place.

        And setting up PHP is already a hassle. When a dev has to set up php in about 5 separate ways just to figure out which one is actually debuggable, then PHP has a problem.

  • Zany Hog@lemmy.jcaks.net
    cake
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    I’m keen for this community to gain some traction, hopefully it’s a bit less toxic than our reddit counterpart.

    I would love to see Generics and custom Types in PHP. Generics for obvious reasons. And Types so we don’t need to create a DTO just for type-hinting of objects. Combined with Generics, so we can have typed Arrays!

    • SALT@lemmy.my.id
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I’m keen for this community to gain some traction, hopefully it’s a bit less toxic than our reddit counterpart.

      I’m curious, does brent_gd is that bad in moderating /r/php ? Or it’s just they community is toxic there?

  • msage@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    How about real threads?

    There used to be some pthreads support, but it wasn’t very good.

    Also some native event IO support. I tried playing around with libevent, but was not very successful with it.

  • Zd47@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    11 months ago

    Genetics, updated built-in functions (types, order of arguments, naming), better attribute reading support (should be easier), threads or support long running processes, one line methods (kotlin like), updated env-var handling especially $_SERVER/POST/GET…

  • abhibeckert@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Honestly I’m pretty happy with PHP 8 from a feature set standpoint.

    Threading would be nice but generally I want long running tasks to run outside of the HTTP stack anyway so that’s less of an issue.

    I wish wish the dollar signs and semicolons were optional. And I wish -> was replaced with a single character that’s easy to type. Like maybe the . key. PHP is a great language with pretty terrible syntax.