From PHP 5.6 to PHP 8.2

Поделиться
HTML-код
  • Опубликовано: 10 окт 2023
  • This is the "From PHP 5.6 to PHP 8.2" segment from my "What's new in PHP 8.3 " livestream. Watch the full livestream here: ruclips.net/user/liveWUz19fb5zgw.
    ----------------------------------------------------------------------------------------------------
    - Twitter: / enunomaduro
    - Threads: www.threads.net/@enunomaduro
    - Mastodon: mastodon.social/@nunomaduro
    - LinkedIn: / nunomaduro
    - RUclips: / nunomaduro
    - GitHub: github.com/nunomaduro
    - Bluesky: bsky.app/profile/nunomaduro.b...
    - Tiktok: / enunomaduro
  • НаукаНаука

Комментарии • 57

  • @Apocalyarts
    @Apocalyarts 9 месяцев назад +2

    Wow, very nice and a super compact rundown, thx!

  • @ahmedyoussef7923
    @ahmedyoussef7923 3 месяца назад

    PHP getting better every new version .
    Thank you very much ❤

  • @FreddieOmega
    @FreddieOmega 9 месяцев назад +1

    awesome explanations!

  • @jadidlar4765
    @jadidlar4765 9 месяцев назад +1

    thank you for your video

  • @waltermelo1033
    @waltermelo1033 5 месяцев назад +1

    that thumb reflect my thoughts. I'm really considering migrate from JS to PHP too...

  • @it-s-me-mohit
    @it-s-me-mohit 7 месяцев назад +1

    Great video nuno. I had one question. I have a legacy PHP application version 5.4 using zend, symfony, restler rtc. Wanted to upgrade it to the latest version. Is it better to rewrite it from scratch in a new framework like laravel or migrate everything and stay on the same frameworks

  • @shalakadeshan
    @shalakadeshan 9 месяцев назад +4

    Great video Nuno 👏. Hopes PHP never ceased to improve and evolve. PHP should provide an easy and smooth transition for developers. What tool you used to change php version easily, using mac?

    • @nunomaduro
      @nunomaduro  9 месяцев назад +1

      brew.sh/

    • @shalakadeshan
      @shalakadeshan 9 месяцев назад +1

      @@nunomaduro Yes, I have been using it, however sometimes changes require a restart. Thanks anyway.

  • @phpannotated
    @phpannotated 9 месяцев назад +2

    ❤ PHP

  • @user-sb7vv4bf6d
    @user-sb7vv4bf6d 8 месяцев назад

    What is the ABC app in the Menubar?

  • @coder_one
    @coder_one 9 месяцев назад +1

    Certainly, to check whether you can override the variable $name marked as "readonly" or placed in the "readonly" class, you still need to run this code. That's how PHP works... You find out about existing errors in the code from clients using the production application ;)

    • @spicynoodle7419
      @spicynoodle7419 9 месяцев назад +2

      PHPstan will help with this

    • @TheRafark
      @TheRafark 8 месяцев назад

      This would be caught when unit testing. If this is caught in production it means you don’t test your code, which is wild

  • @SaiyanJin85
    @SaiyanJin85 9 месяцев назад +1

    The only thing that is missing is typed arrays.

    • @nunomaduro
      @nunomaduro  9 месяцев назад +1

      With PHPStan, we support those.

  • @mmahgoub
    @mmahgoub 9 месяцев назад +1

    TypeScript is that you?

  • @DrYouz
    @DrYouz 8 месяцев назад +1

    What is your font used in your IDE please ?

    • @DrYouz
      @DrYouz 8 месяцев назад

      You like but you tell me :)

    • @DrYouz
      @DrYouz 8 месяцев назад

      ?

  • @lucasj.pereira4912
    @lucasj.pereira4912 9 месяцев назад +4

    Now we only need the constructor to make the "{ }" optional because a lot of times it is just empty. Like we have in interfaces: public function __constructor (public string $name);

  • @DeTechDivus
    @DeTechDivus 9 месяцев назад +1

    Would've been nice if we could remove empty {} as well

  • @spicynoodle7419
    @spicynoodle7419 9 месяцев назад +1

    You sbould have showed off the algebraic types like string|null or Arryable&Responsable

    • @nunomaduro
      @nunomaduro  9 месяцев назад +2

      Yeah - but wanted keep the example simple.

  • @brandon26
    @brandon26 9 месяцев назад +2

    Do you know of any performance improvements in this new versión?

  • @jamesrosemary2932
    @jamesrosemary2932 9 месяцев назад

    Sitll waiting for setters and getters.

  • @GAoctavio
    @GAoctavio 9 месяцев назад +2

    I think proper standard engine support for async, futures, coroutines and threading is due

    • @maxymajzr
      @maxymajzr 7 месяцев назад

      What would you use threading for? I'm interested to know what you have going on as challenge with which threading helps.

    • @GAoctavio
      @GAoctavio 7 месяцев назад

      @@maxymajzr I'm currently generating loads of PDFs in parallel with Dompdf, the only way of not stalling the request for 15 minutes its to use Laravel Jobs but thats an architectural mess IMO (not very elegant to have an external program as supervisor, I found it breaks very often, doesn't reload the configuration properly, etc).
      In the end I replaced it with proc_open with correct command arguments to run the proper job, marshalling job data into the database as JSON.
      It would be trivial with a Thread Pool implementation, but I'd need to recompile the PHP interpreter and I don't know how fiddly the support is. Proper implementation and testing would take me a lot of time

    • @jmon24ify
      @jmon24ify 7 месяцев назад

      Have you tried reactphp?

    • @GAoctavio
      @GAoctavio 7 месяцев назад

      @jmon24ify
      Looks interesting but I don't how useful it would be with my problem since Dompdf doesn't really block aside from when writing to disk once it has processed everything and I'd have to write a new service to even begin to try

    • @winfle
      @winfle 5 месяцев назад

      @@GAoctavioyou can use pthreads, But generally I recommend to use something like Golang for heavy workload and offloading these parts.

  • @mateussantana4418
    @mateussantana4418 9 месяцев назад +1

    PHP became a great and robust programming language! What a shame it's dying 😆

    • @nunomaduro
      @nunomaduro  9 месяцев назад +2

      It's not dying. 👍🏻

    • @mateussantana4418
      @mateussantana4418 9 месяцев назад +1

      @@nunomaduro it was a joke 😄

    • @levyroth
      @levyroth 9 месяцев назад +1

      It was never great, and it will never be. Let it die.

    • @nunomaduro
      @nunomaduro  9 месяцев назад +3

      @@levyroth Over my dead body

    • @muhammadawwab4402
      @muhammadawwab4402 9 месяцев назад

      @@levyroth you would die first

  • @dominiq6864
    @dominiq6864 9 месяцев назад +1

    I really like the direction PHP is developed in recent years. But unfortunately, it still sucks (and sadly will suck forever). It still has:
    - The infamous inconsistent argument ordering: strpos($haystack, $needle, $offset) and array_search($needle, $haystack, $strict) - facepalm 🤦‍♂
    - Lack of proper module system - importing all files to the global scope and bothering with complex namespaces is a nightmare
    - Awful ancient "

    • @8LynX8
      @8LynX8 9 месяцев назад +2

      You are right BUT:
      - Inconsistent argument ordering - YES, but it is not a big deal, when you are using modern IDE
      - Lack of proper module. Not sure what you mean, but it is solved by composer autoloader. Basically it is must have
      - "

    • @dominiq6864
      @dominiq6864 9 месяцев назад +1

      @@8LynX8 yeah, well I think backward compatibility causes most flaws of PHP, unfortunately 😅 I really hope they will eventually introduce more consistent APIs in future releases and deprecate old ones - then PHP would probably be one of the best server-side languages for backend devs

    • @b0janix
      @b0janix 9 месяцев назад

      I agree about the inconsistencies in the argument ordering, but since PHP 8 you have this thing called named arguments. So you just need to know the name of the argument passed to that function and you can place the arg anywhere in the param signature

    • @dominiq6864
      @dominiq6864 9 месяцев назад

      @@b0janix yeah, named arguments help a lot and I must admit that other languages should implement this feature as well (but this doesn't justify previous PHP's bad design decisions)
      Nevertheless I wish PHP will fix some of its flaws in future versions, maybe it is going to be great some day ;)

    • @GamePlayByFaks
      @GamePlayByFaks 9 месяцев назад +1

      seems you haven't used composer 2 and php 8.2 and some recent framework like laravel or symfony, about 90% of your issues are solved. add phpstan level 10 and strict type on top and you will never have any major issues in general.