Wait... is there no way to install #PHP 7.4 under #Ubuntu 22.04? I just need it temporarily so I can upgrade #Nextcloud...
#PHP jobs increasingly seem to want experience with a framework, preferably Laravel.
I've been too busy working with MediaWiki and writing my own framework to learn another one. Am I doomed?
Sincerely.
Disemployed in Durham
P.S. Do I really have to learn #MVC or am I also additionally doomed because I doan wanna?
I figured out some things this morning about function-variables in #PHP.
You're welcome.
Wow... is there really no clean way to detect an improperly serialized string in #PHP?
I tried the @
technique, and it still throws a fatal error.
The only solution I can find seems to be basically reverse-engineering the format and checking for likely issues before trying to parse it: https://stackoverflow.com/questions/1369936/check-to-see-if-a-string-is-serialized
As a result of this, I have now used code from StackOverflow absolutely verbatim. Just yesterday I told @eryn I had managed to avoid ever doing that... :D
I'll take consolation from the fact that I'm doing it as a kluge around a bug in #MediaWiki rather than in my own code.
I have decided that I will refer to "exceptions" as "hissy fits" in my documentation. #PHP
It's really kind of irritating that #PHP native exceptions don't seem to ever set a numeric code, making it more difficult than it should be to detect specific error conditions -- especially when part of the error message is a variable, as in
Class '[name of class]' not found
I'm going to have to use regex for this. It should just be a numeric code, but the getCode()
for this error is 0, as it is for pretty much all of them as far as I can tell.
Has anyone out there ever successfully set up step-through debugging in #PHP? Needing it more and more...
Would prefer if it could be used with Kate, but I'll accept KDevelop or any other FOSS editor...
Oh, so you can do abstract static
functions in #PHP. Why did I think that wasn't a thing?
Thinking about it... in #PHP, why are interface
s and trait
s even different things?
Everything you can do with an interface
:
This is functionally the same as defining an abstract public function
in a trait.
This is functionally the same as a trait use
-ing another trait.
This is functionally the same as use
-ing a trait that consists entirely of abstract public functions.
This is the one thing a trait cannot do -- but I don't understand why it was done that way.
Note: this seems related to my trait implements wishlist item from earlier. At first I thought that they might be in conflict, but on looking at the syntax in more depth, I don't see how. A trait that uses/extends another trait is also declaring abstract functions in that trait as an implementation requirement.
Putting both of these suggestions together would both simplify the language and make it more powerful, I'd think.
#PHP experts: is there any non-destructive way to tell if a variable contains a reference rather than a literal value?
very mild PHP gripe
array_key_exists()
is just backwards, that's all. The array should come first, and then the index. Why, #PHP.
I keep forgetting to include the keyword function
when declaring functions in #PHP. Does this mean my brain is pining for C++ or something? 🧠
#PHP 7 was giving me the ever-popular blank-screen look, and it turned out to be entirely due to a break;
which had somehow ended up in the wrong place.
That shouldn't be a showstopper, guize. #softwareGripe #PHP7thWorldProblems
There needs to be a companion to the final
keyword in #PHP.
Background: The "final" keyword indicates that a method cannot be overridden in a child class.
Wish: There needs to be a first
keyword to prevent accidentally creating a method ancestor which might get completely bypassed because a descendant doesn't call parent::[method]
because it doesn't expect one to exist.
Either that, or a way to allow calls to parent::[method]()
even when there's no method ancestor.
...or else a way to define a method such that each generation gets called automatically -- except that takes away sequencing control, which would cause problems.
You can get a list of an object's methods with get_class_methods()
, but it would be really really nice to get additional info along with each listing -- mainly the filename and line where the method is defined.
You can make #PHP throw an error if a function is called without expected arguments, but not if a function is called with more arguments than expected.
I think maybe #PHP8 fixes this by allowing "void" as an argument type? I don't yet have a system with PHP8 on it, though, so I don't actually know.
If it doesn't, then this is a #softwareGripe.
#PHP, and not exactly a #softwareGripe but almost
a herd of cats, most of whom are asleep at any given time
supreme Uberwensch of toot.cat
still going largely on potential.
1965-2165
creative: https://woozalia.com
technical: https://wooz.dev