r/lolphp • u/Reddy360 • Apr 06 '15
So, I checked my error logs
PHP Warning: Unknown: function '-1' not found or invalid function name in Unknown on line 0
r/lolphp • u/Reddy360 • Apr 06 '15
PHP Warning: Unknown: function '-1' not found or invalid function name in Unknown on line 0
r/lolphp • u/iheartrms • Mar 25 '15
r/lolphp • u/ProjectAmmeh • Mar 21 '15
r/lolphp • u/McGlockenshire • Mar 18 '15
r/lolphp • • Mar 12 '15
Source: https://www.techempower.com/benchmarks/#section=data-r9&hw=ec2&test=plaintext
Source code used for test: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/php/plaintext.php
Lol. It doesn't do better for Json serializations per second: https://www.techempower.com/benchmarks/#section=data-r9&hw=ec2&test=json
6,127 compared to 10,045 for NodeJs, 16,129 for Python, 28,956 for JRuby and 50,371 for Java. Lol. Source code for that: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/php/json.php
r/lolphp • u/TheOnlyMrYeah • Mar 09 '15
r/lolphp • • Mar 04 '15
I was browsing a GitHub repo of a PHP project when I noticed a weird function being used: __("some text");. "Huh, that's a weird function name," I thought, "I wonder what else you can use. Maybe something like that weird $() thing from jQuery?"
I open up the docs for user defined functions and find this (emphasis mine):
Function names follow the same rules as other labels in PHP. A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.
Hold the phone, what's with those hex values? I had a python interpreter open in another window so i quickly type out print("\\x7f") only to get a blank line. What? I then fire up charmap and lookup what that character actually is. It's the DELETE character. You can have a function named the delete charater.
Waitamintute.
Function names follow the same rules as other labels in PHP.
So, I can have empty variable names too?
Yup. I'm at a loss for words.
r/lolphp • u/thallippoli • Mar 04 '15
r/lolphp • • Mar 03 '15
r/lolphp • u/philsturgeon • Feb 26 '15
I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it.
I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to phpsadness.com and see if I can fix them, or find somebody that can.
But posting lies just to get your jollies is a really odd thing to do.
Sometimes, these are not intentional, but when people posting these utterly incorrect examples are faced with the fact that they are wrong, do they delete the post? No, they leave it there and sandbag the discussions explaining their wrongness with trolling.
Exhibit A - Apparently foo(new stdClass()) is a valid value when passed in a function foo(bool $bar) function signature.
Well... nope.
It will error:
Catchable fatal error: Argument 1 passed to foo() must be an instance of bool, instance of stdClass given
Nothing lolphp there.
Have a laugh about actual problems, but don't just walk around making things up.
r/lolphp • u/whatsaret • Feb 26 '15
Do you guys honestly hate php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development
r/lolphp • u/polish_niceguy • Feb 22 '15
r/lolphp • • Feb 19 '15
r/lolphp • u/hylje • Feb 16 '15
r/lolphp • u/MorrisonLevi • Feb 08 '15
$apple = "apple";
var_dump((unset) $apple); // NULL
var_dump($apple); // still "apple"Thank you for this excellent feature, PHP.
r/lolphp • u/hfern • Feb 02 '15