Follow

I'm helping one of my employees learn in . Sadly missing a repl, we just use `vardump($thing)` a ton to figure out how to get the field. Also, in PHP `== No` evaluates to `== "No"`. Seriously??

@josemanuel Fails because symbols are not strings. Why on earth does that work?

@worldsendless It's not a strict equality test, so it kinda makes sense to have No changed to 'No' to make it work. It's the same thing you'd get if you tried `0 == '0'`.

If you think about it, Common Lisp does the same. ASDF, for instance, accepts both `:system` and `"system"` as system identifiers.

Nevertheless, as @zimzat pointed out elsewhere in this thread, PHP no longer works that way in modern versions, so I'd urge you to upgrade for a better experience.

@worldsendless You're going to hit every landmine PHP has ever had.

Use the latest supported versions; `== No` is no longer possible in 8.0+ php.net/supported-versions.php 3v4l.org/I0GqJ

Ensure you're running with php.net/manual/en/errorfunc.co = E_ALL

`php -a` is the closest thing to a native repl, but there's others like github.com/ramsey/composer-rep or psysh.org/

Or step debugging with xdebug.org/docs/step_debug

phptutorial.net/ + phptherightway.com/

@worldsendless PhpStorm is worth the cost if you're doing any amount of serious coding: jetbrains.com/phpstorm/

@zimzat We are running a fair-sized operation here so changing the versions and the configs isn't done easily, and because the workforce is largely transient university student developers we cannot pay licensing fees for a specialized tool like PHP Storm; the students are on and I am on , both of which are great for working in many languages

@worldsendless

PhpStorm has paid per-seat transferable business licenses.

Upgrading the version has be a minimum requirement: PHP 7.4 and earlier is no longer supported, no matter what WordPress says their minimum is.

It sounds like you're in a bind unless you treat it like a en.wikipedia.org/wiki/Gordian_

@worldsendless this produces en error since PHP 8 (released 3 years ago). PHP 7 has reached EOL on november 2022.

@manal The big takeaway I'm gathering from this thread is that I need to bite the bullet and get the upgraded PHP on our server, at the risk of our WordPress farm of 100+ sites...

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.