23

Our dev server runs php 7.4

Our production servers run php 7.2

Comments
  • 1
    I upvoted this rant because of PHP 🉐
  • 8
    >Our server runs PHP
    All your problems began there.
  • 3
    @catgirldev what amazes me to this day is that PHP ignores lower/uppercase, i.e.
    foo() and
    FOO()
    are the same thing, and some retards even defend it.
  • 1
    We have a similar problem, but we use VSCode and the Intelephense extension let's you set PHP compatibility level per project.
  • 0
    during the process of updating to a higher language version, you have to test your code with both versions or be prepared to do a reversible atomic switch. Always test on the version, the code will be run on in production.
  • 0
    @EdoPhoenix it's not ideal but I've been programming in PHP for a decade and that was never a problem.
    So in anything PHP 5.3 and greater one should use namespaces anyway. That even further abolishing the chances of conflict.
  • 1
    @EdoPhoenix I love PHP. Makes sense, works all the time, good documentation. The worst thing anyone ever seems to say about PHP is that it's easy to use, which apparently is bad?
  • 0
    @spongegeoff it's not easy to use, its easy to write bad code with it.

    Check the vulnerabilities in php projects.

    And fucking die() to debug is still the easiest way to debug what's going on, while if you had a sane programming language you would just debug your code.

    In 2022 using php to do anything on production is just wrong.

    I maintain a php site I inherited, and I am looking forward to kill it with fire.
  • 2
    @Feibrix Couldn't agree less. Use XDebug, for a start. I can never see the appeal of having to write five times as much code to achieve the same thing, or that having a bunch of excuses for failing was useful. Just check out something really basic, like adding something to an array? Downright convoluted in VBA, Python not much better. PHP just works.
  • 0
    @spongegeoff vba? You know that there are real languages out there?
  • 1
    @Feibrix personally I can't stand PHP anymore, but correctly configured Xdebug with a matching IDE extension (and a good language server like Intelisense) makes PHP not much worse than any modern pre-compiled language.

    Just have to make sure you're running on 7.2+ and have the discipline to use parameter and return type declarations correctly.
  • 0
    It's certainly much easier to write bad PHP if you're lazy than other languages, but the same can be said of Javascript or any other dynamically typed language.
  • 1
    @Feibrix what would you suggest instead of php? To use CGI?
  • 0
    @kwilliams yes, thats why in serious environments you use typescript. Js wasn't designed to be used as we use it today, and it shouldn't. And this applies to php too, not designed to do production stuff, it shouldn't be used.
    Then, I know people still using vb6 because it rocks, so you can certainly choose your torture device.
  • 1
    @Feibrix

    "And this applies to php too, not designed to do production stuff"

    And yet it does so much production stuff, on a worldwide basis, each day and every day. Perfectly well, as a huge part of the global economy. I'd use javascript if the clients wanted 30 second page loads with the content jumping around, but they don't.

    VBA - when your boss asks you to sort out some legacy VBA, you sort out the legacy VBA. Even if - news just in - there are other languages on the planet.
  • 0
    @Feibrix I read a lot of baseless and stupid opinions presented as absolutes and facts.

    Just think about on how many people that have been working on this highly successful language for decades you take a dump on.
    Are you that you are such an amazing scientist?
  • 0
    @hjk101 highly successful language doesn't mean it is a good language. You can't use this argument against my points because, well, it's not a fact too. Javascript is used EVERYWHERE and it is a bad language. This is a fact and a proof that you can be successful and still wrong.

    Not recognising that this "widely used language" offers more problems than solutions shows how poorly PHP defenders understand their tools.

    You don't need to be an amazing scientist to see this, you just need to know more than a single programming language.
  • 0
    @Feibrix

    "You just need to know more than one language"

    We do. If other languages were great in comparison to php and js, for the purposes that those languages are intended for, they'd be used more. They aren't, because they're not.
  • 0
    @Feibrix

    "shows how poorly PHP defenders understand their tools."

    This from someone who debugs with die() .

    !competent , but opinionated anyway...
  • 0
    @spongegeoff What do you mean? Writing on the internet that every language that is not PHP is not used doesn't make it true. :/

    Js is different: you can run only js on a lot of platforms. Devs are forced to use it, and to make it less painful, they tried to change it. From coffeescript to typescript. This is the community screaming IT SUCKS, and you cannot just ignore it.

    Other languages are just languages, and they all have goods and bads, but they all have something in common: they are better than php.

    Do you want an example? == / ===. Or json_decode to be used with json_last_error to see if NULL was a valid result or an invalid result.

    PHP was designed for non programmers, not to build complex software, and doesn't matter how many patches, versions, or active projects it has, it is still a bad programming language.
  • 0
    @spongegeoff I haven't found a better way to debug a live wordpress with an autoupdated extension that crashed everything because the PHP version was not the correct one.

    PHP is an unjustified pain, and creating more php software means only adding more technical debt to people that will need to maintain it.

    And I said, you do what you want, you can even like it, but you cannot say that it is a great programming language. It just can't be.
  • 0
    @Feibrix

    "I haven't found a better way to debug a live wordpress"

    ... but those better ways do exist. Sounds as if you're not even across basic error messaging, php extensions, local working and very much else. I'm hesitant to say anything, but you should start with getting the right version of php, ensuring you have the required PHP extensions, enabling error reporting, working and debugging on a local copy. It doesn't sound as if the issues require a deeper analysis - presumably, the WP extension works for other people if PHP is configured correctly - but if you ever needed to, e.g. you were developing new code, you'd be able to see all your variables, set up interrupt points and analyse line by line with xDebug and phpStorm.
Add Comment