Announcement

Collapse
No announcement yet.

PHP 7.3 Enters Feature Freeze & Releases Beta

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP 7.3 Enters Feature Freeze & Releases Beta

    Phoronix: PHP 7.3 Enters Feature Freeze & Releases Beta

    The end of July marked the code branching and feature freeze for PHP 7.3 followed by the creation of the first beta...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Syntactically and feature-wise PHP is quite a nice language, although it does not support decorators (annotations).
    It's quite a good language to make money and do consulting work with WordPress, Drupal and such.

    It's also quite easy to use, and easy to get started with. You can easily self-host it on your workstation, there is no need to compile anything, and it works on pretty much all web hotels and clouds.

    The downside is that the standard library and the API is horribly inconsistent and unpredictable. Almost everything are just functions in the global namespace. Functions return values such as -1 on error instead of throwing exceptions, etc.

    Comment


    • #3
      Originally posted by uid313 View Post
      Functions return values such as -1 on error instead of throwing exceptions
      As if that's a bad thing.

      Comment


      • #4
        Originally posted by Weasel View Post
        As if that's a bad thing.
        Yes, because -1 is a "magical value" that somehow means something went wrong. Anything could have gone wrong, you have no idea what went wrong.

        Throwing exceptions is much better, then there are different kinds of exceptions, so you know if it was an argument error or an invalid operation error, or whatever it is, and it can contain a useful message that clearly explains the why the error occurred.

        PHP does have support for exceptions too, but its mostly used in code you write yourself and third-party libraries and frameworks. Its not widely used in the PHP standard library.

        Comment


        • #5
          Originally posted by uid313 View Post
          Yes, because -1 is a "magical value" that somehow means something went wrong. Anything could have gone wrong, you have no idea what went wrong.

          Throwing exceptions is much better, then there are different kinds of exceptions, so you know if it was an argument error or an invalid operation error, or whatever it is, and it can contain a useful message that clearly explains the why the error occurred.

          PHP does have support for exceptions too, but its mostly used in code you write yourself and third-party libraries and frameworks. Its not widely used in the PHP standard library.
          Is there no error code in PHP? (errno)

          But I thought you were referring to "error codes" vs "exceptions" kind of thing. Exceptions are, in most cases, way worse and people aren't even aware of it. Writing truly exception-safe code is exceptionally difficult, and it's much harder to track down than lack of error code handling.

          Comment


          • #6
            Originally posted by Weasel View Post
            As if that's a bad thing.
            That's one of the reasons shell script isn't a proper programming language.

            "something failed, yo!" isn't really helpful in debugging breakage.

            Comment

            Working...
            X