subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
lolphp
prema_van_smuuf
cxq21gu
<|sols|><|sot|>The last ever line of (php) code.<|eot|><|sol|>http://www.commitstrip.com/en/2015/11/13/the-last-ever-line-of-code/<|eol|><|sor|>Then I won't have the pleasure of discovering PHP "features" like this one... $some_bool = false; $some_bool['foo'] = "bar"; print_r($some_bool); // array("foo" => "bar") ...php go home, you're drunk<|eor|><|sor|>Jeez. At least it has the courtesy to whine when you do that to a string or number, and it fatals when you do it to an object, but why does it "succeed" silently for a bool?<|eor|><|sor|>Not even a bool, just "false"! If you try to use "true" as an array, it complains the same way... blah blah scalar value as an array blah blah. *facepalm*<|eor|><|sor|>False is being retyped to an empty array. Mystery solved.<|eor|><|eols|><|endoftext|>
8
lolphp
McGlockenshire
cxdinbn
<|sols|><|sot|>The last ever line of (php) code.<|eot|><|sol|>http://www.commitstrip.com/en/2015/11/13/the-last-ever-line-of-code/<|eol|><|sor|>Then I won't have the pleasure of discovering PHP "features" like this one... $some_bool = false; $some_bool['foo'] = "bar"; print_r($some_bool); // array("foo" => "bar") ...php go home, you're drunk<|eor|><|sor|>Jeez. At least it has the courtesy to whine when you do that to a string or number, and it fatals when you do it to an object, but why does it "succeed" silently for a bool?<|eor|><|eols|><|endoftext|>
7
lolphp
khamer
684l1p
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|eols|><|endoftext|>
158
lolphp
SirClueless
dgvp1cg
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|eols|><|endoftext|>
76
lolphp
beerdude26
dgvsdon
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|sor|>This would make for some fun code golf<|eor|><|eols|><|endoftext|>
43
lolphp
youstolemyname
dgvyula
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|sor|> echo 1 * (1...2)..3; 10.20.3<|eor|><|eols|><|endoftext|>
19
lolphp
MeLoN_DO
dgwaozp
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|sor|> echo 1 * (1...2)..3; 10.20.3<|eor|><|sor|>And `2...2*2...2*2...2` is `20.40.40.2`<|eor|><|eols|><|endoftext|>
16
lolphp
khamer
dgvz54a
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|sor|> echo 1 * (1...2)..3; 10.20.3<|eor|><|soopr|>You don't even need the parenthesis.<|eoopr|><|eols|><|endoftext|>
15
lolphp
the_alias_of_andrea
dgwh93f
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|soopr|>Yeah, that's exactly what's happening, just unexpected, especially with `...` being syntax for the splat operator now.<|eoopr|><|sor|>Well, the lexer tries to grab as many characters as it can for the first number. It sees `5`, and takes that, then `.`. There is then no longer string that is a valid number. The following character is a valid operator, `.`, and there's no longer string that could be something else. Then you get the `.5`. There's no other way to tokenise this, basically.<|eor|><|eols|><|endoftext|>
14
lolphp
khamer
dgvzexl
<|sols|><|sot|>1...1 is 10.1<|eot|><|sol|>https://3v4l.org/jmrZB<|eol|><|sor|>Looks like this is parsed as `(1.) . (.1)`, and the `.` operator stringifies both sides making this `"1" . "0.1"`. That's actually hilarious. Especially given that PHP is loosely typed and you can use "10.1" as a number if you like: `4 * (1...1)` is 40.4 for example.<|eor|><|soopr|>Yeah, that's exactly what's happening, just unexpected, especially with `...` being syntax for the splat operator now.<|eoopr|><|eols|><|endoftext|>
11
lolphp
hylje
1e4foy
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|eols|><|endoftext|>
158
lolphp
jdiez17
c9wpzqr
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>"We've found 72,594 code results" Oh fuck no.<|eor|><|eols|><|endoftext|>
49
lolphp
tdammers
c9wr940
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>That's one of the main problems with PHP: it's looks easy for amateurs and they're encouraged by the language and by the standard library to keep onto their bad practices even when they start building something non-trivial. The mentality of "you just put it in somewhere and it will work!" leads to (among other things) accidental creations of HTTP API's for SQL databases that simply work when you put some input in.<|eor|><|sor|>I've said it before, and I'll say it again: PHP makes stupid things easy and accessible, and the right things difficult, obscure and hard to discover. The code in those search results is very readable, it works "flawlessly", it makes sense, and every idiot can understand it. Unfortunately, it's wrong, and the correct alternative takes about twice as much work, looks like someone barfed some half-digested incorrect Perl over a mutilated chunk of HTML, and requires an actual programmer with an IQ above 70 to understand.<|eor|><|eols|><|endoftext|>
34
lolphp
xiongchiamiov
c9wt66a
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>I feel like a community pull request / education effort is needed. Edit: One shower, one quick hack-job, and one waiting-for-Github-to-build-the-damn-page and [we're live](http://programmer-education-foundation.github.io/).<|eor|><|eols|><|endoftext|>
31
lolphp
okiyama
c9wuxda
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>Wow, while searching through the results I found this: https://github.com/hamo556/ootw The readme.md is just: >you are not allowed to use this code So it's some guy that not only made hilariously easy to inject code but also doesn't understand that he has made his code completely open to the public.<|eor|><|eols|><|endoftext|>
24
lolphp
m1ss1ontomars2k4
c9wwm3j
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>Wow, while searching through the results I found this: https://github.com/hamo556/ootw The readme.md is just: >you are not allowed to use this code So it's some guy that not only made hilariously easy to inject code but also doesn't understand that he has made his code completely open to the public.<|eor|><|sor|>https://www.offersontheweb.co.uk/ That's the site, and the title is now "GAY BUTT SEX". It used to be "Offers on th web", including the typo. Wat. EDIT: And why does the repo include a dump of the database?!?! Wat.<|eor|><|eols|><|endoftext|>
24
lolphp
vytah
c9wr2gs
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>That's one of the main problems with PHP: it's looks easy for amateurs and they're encouraged by the language and by the standard library to keep onto their bad practices even when they start building something non-trivial. The mentality of "you just put it in somewhere and it will work!" leads to (among other things) accidental creations of HTTP API's for SQL databases that simply work when you put some input in.<|eor|><|eols|><|endoftext|>
22
lolphp
ootwthrowaway
c9x7naq
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>Wow, while searching through the results I found this: https://github.com/hamo556/ootw The readme.md is just: >you are not allowed to use this code So it's some guy that not only made hilariously easy to inject code but also doesn't understand that he has made his code completely open to the public.<|eor|><|sor|>https://www.offersontheweb.co.uk/ That's the site, and the title is now "GAY BUTT SEX". It used to be "Offers on th web", including the typo. Wat. EDIT: And why does the repo include a dump of the database?!?! Wat.<|eor|><|sor|>Yeah. I found that repo through this reddit post, and I didn't like their readme. Originally I was going to have fun trying to SQL inject the login page, but the SQL dump has all the admin usernames and passwords in PLAIN TEXT (right next to the MD5 sum of them, almost threw me off because I never imagined they would store the plaintext password next to the hash...). So I logged in to the admin page, deleted everything (including the admin accounts, don't you tricksters try to vandalize their website now!), and replaced the front page with The Raven by Edgar Allen Poe. I love poetry! I probably could have found an exploit somewhere to execute PHP and delete all the files. But it was late. Good exercise for them, though. It'll just be a nice practice of the restoration part of their database backup strategy! :) Hmm. The website is down. They must still be restoring their database and patching their security holes!<|eor|><|eols|><|endoftext|>
19
lolphp
huevas
c9wxyq8
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>Wow, while searching through the results I found this: https://github.com/hamo556/ootw The readme.md is just: >you are not allowed to use this code So it's some guy that not only made hilariously easy to inject code but also doesn't understand that he has made his code completely open to the public.<|eor|><|sor|>[You are not allowed to look at my db credentials](https://github.com/hamo556/ootw/blob/master/includes/db_connect.php)<|eor|><|eols|><|endoftext|>
17
lolphp
nikomo
c9wxiaf
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>Wow, while searching through the results I found this: https://github.com/hamo556/ootw The readme.md is just: >you are not allowed to use this code So it's some guy that not only made hilariously easy to inject code but also doesn't understand that he has made his code completely open to the public.<|eor|><|sor|>https://www.offersontheweb.co.uk/ That's the site, and the title is now "GAY BUTT SEX". It used to be "Offers on th web", including the typo. Wat. EDIT: And why does the repo include a dump of the database?!?! Wat.<|eor|><|sor|>>EDIT: And why does the repo include a dump of the database?!?! Wat. You're asking this question, when the person in charge of the repo said you can't use the code that he just publicly uploaded for everyone to see?<|eor|><|eols|><|endoftext|>
15
lolphp
Daejo
c9x74p4
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>"We've found 72,594 code results" Oh fuck no.<|eor|><|sor|>In the 19 hours since you posted that, it's gone down to 72,306. Hey, at least it's going in the right direction.<|eor|><|eols|><|endoftext|>
12
lolphp
donri
c9x8ndp
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>Wow, while searching through the results I found this: https://github.com/hamo556/ootw The readme.md is just: >you are not allowed to use this code So it's some guy that not only made hilariously easy to inject code but also doesn't understand that he has made his code completely open to the public.<|eor|><|sor|>GitHub doesn't require public repositories to have an open source license. In copyright, the default is all rights reserved. It's a perfectly valid way around the fee for private repositories.<|eor|><|eols|><|endoftext|>
12
lolphp
phaeilo
c9wq017
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>If only placeholders If only these PHP "developers" knew about placeholders My poor aching head<|eor|><|sor|>> placeholders I'm confused. Do you mean parameterized quries?<|eor|><|eols|><|endoftext|>
11
lolphp
hylje
c9wwu2r
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>So what's new?<|eor|><|soopr|>We've known this actually happens in the wild. Here it's actually happening under your very eyes.<|eoopr|><|eols|><|endoftext|>
11
lolphp
mindlessLemming
c9wwgey
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>If only placeholders If only these PHP "developers" knew about placeholders My poor aching head<|eor|><|sor|>> placeholders I'm confused. Do you mean parameterized quries?<|eor|><|sor|>Aren't the markings you put in your parameterized query called placeholders?<|eor|><|sor|>"bindings" or "bound parameters" in my experiece.<|eor|><|eols|><|endoftext|>
9
lolphp
dagbrown
c9wpkcj
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>If only placeholders If only these PHP "developers" knew about placeholders My poor aching head<|eor|><|eols|><|endoftext|>
8
lolphp
KFCConspiracy
c9wtl4y
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>I would consider firing someone over that. <|eor|><|eols|><|endoftext|>
8
lolphp
gianhut
c9xx123
<|sols|><|sot|>The love story of mysql_query and $_GET on Github.<|eot|><|sol|>https://github.com/search?p=1&q=extension%3Aphp+mysql_query+%24_GET&ref=searchresults&type=Code<|eol|><|sor|>I feel like a community pull request / education effort is needed. Edit: One shower, one quick hack-job, and one waiting-for-Github-to-build-the-damn-page and [we're live](http://programmer-education-foundation.github.io/).<|eor|><|sor|>may I also recommend that if you decide to do a pull request on one of these repos, fix 1 or 2 as example and have the original author fix the rest so he/she can get in the habit of doing the same.<|eor|><|eols|><|endoftext|>
8
lolphp
xiongchiamiov
1t23nw
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|eols|><|endoftext|>
153
lolphp
WannabeDijkstra
ce3k0ht
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>*Yes, I am a terrible coder, but I am probably still better than you :)* The ride never ends with Rasmus Lerdorf.<|eor|><|eols|><|endoftext|>
57
lolphp
frezik
ce42shi
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Wow. It could have taken entire minutes to implement a real hash function, or at very least call out to an existing one <|eor|><|sor|>strlen may be the worst hashing function I have ever heard of. It's one step away from return 0.<|eor|><|sor|>At least `return 0` would have been O(1).<|eor|><|eols|><|endoftext|>
45
lolphp
fragglet
ce3rh6m
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Even when I was a 17 year-old clueless C hacker I knew how to make a better hash function by adding up the characters of the string. Who on earth thinks strlen() is a hash function?<|eor|><|eols|><|endoftext|>
44
lolphp
sloat
ce3klyq
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>*Yes, I am a terrible coder, but I am probably still better than you :)* The ride never ends with Rasmus Lerdorf.<|eor|><|sor|>The first step is admitting you have a problem. Step two is never coding ever again.<|eor|><|eols|><|endoftext|>
36
lolphp
Sarcastinator
ce3rgkd
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Wow. It could have taken entire minutes to implement a real hash function, or at very least call out to an existing one <|eor|><|sor|>strlen may be the worst hashing function I have ever heard of. It's one step away from return 0.<|eor|><|eols|><|endoftext|>
36
lolphp
audaxxx
ce3rr2v
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Can someone ELI5? All his functions had to have a different length?<|eor|><|sor|>No, but the length of functions names had to be uniformly distributed.<|eor|><|sor|>Why?<|eor|><|sor|>He had all of his namespace in a hash table. To find a function pointer by it's name, he looked it up in the table. A hash table can be implemented by using an array and putting all values in there by creating an integer with a hash function `int index = hash(name)` and using that is the index in the array: `functions[hash(name)] = &function` Because there may be collisions in the hash function so that `hash(a) == hash(b)` you can just store a linked list there instead and just append the new value to that list. a and b would then have the same index and to find the correct function you have to iterate the list and check all values. To ensure that you have the least possible collision you can either choose a good hash function or you do it like Rasmus and choose a very, very bad hash function and change the names until it fits. He changed the function names so that his hash function `strlen` was uniformly distributed and all linked lists in his table were equally long. Don't ever do this.<|eor|><|eols|><|endoftext|>
36
lolphp
phoshi
ce3qte9
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Wow. It could have taken entire minutes to implement a real hash function, or at very least call out to an existing one <|eor|><|eols|><|endoftext|>
34
lolphp
Drainedsoul
ce3la0p
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>How did this ever seem like a good idea, to anyone?<|eor|><|eols|><|endoftext|>
32
lolphp
kovensky
ce3ky7k
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Seems the server is getting hammered; copypaste here: On 12/16/2013 07:30 PM, Rowan Collins wrote: > The core functions which follow neither rule include C-style > abbreviations like "strptime" which couldn't be automatically swapped to > either format, and complete anomalies like "nl2br". If you named those > functions as part of a consistent style, you would probably also follow > stronger naming conventions than Rasmus did when he named > "htmlspecialchars". Well, there were other factors in play there. htmlspecialchars was a very early function. Back when PHP had less than 100 functions and the function hashing mechanism was strlen(). In order to get a nice hash distribution of function names across the various function name lengths names were picked specifically to make them fit into a specific length bucket. This was circa late 1994 when PHP was a tool just for my own personal use and I wasn't too worried about not being able to remember the few function names. -Rasmus<|eor|><|eols|><|endoftext|>
29
lolphp
snuggl
ce3q1i1
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>How did this ever seem like a good idea, to anyone?<|eor|><|sor|>if you limit your code to just good ideas you will never get done!<|eor|><|eols|><|endoftext|>
27
lolphp
cparen
ce409j7
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>*Yes, I am a terrible coder, but I am probably still better than you :)* The ride never ends with Rasmus Lerdorf.<|eor|><|sor|>The first step is admitting you have a problem. Step two is never coding ever again.<|eor|><|sor|>I don't get the hate. Sounds like php was the perfect language for Rasmus. If there is blame to be had, it's probably with the masses that used it anyway.<|eor|><|eols|><|endoftext|>
23
lolphp
bart2019
ce3sjzo
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>That was before anyone really used it, though.<|eor|><|sor|>Before anyone else used it, it was written in Perl. Perl has proper associative arrays; actually it was the first common language that had them. So this definitely looks like a step backwards, when porting to C.<|eor|><|eols|><|endoftext|>
22
lolphp
frezik
ce42twb
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>That was before anyone really used it, though.<|eor|><|sor|>Before anyone else used it, it was written in Perl. Perl has proper associative arrays; actually it was the first common language that had them. So this definitely looks like a step backwards, when porting to C.<|eor|><|sor|>PHP should have learned from all of Perl's mistakes. Instead, it replicated most of them and then added a bunch of its own.<|eor|><|eols|><|endoftext|>
21
lolphp
xiongchiamiov
ce3ysr7
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>That was before anyone really used it, though.<|eor|><|sor|>The problem here is Rasmus general attitude. When he encountered the problem instead of solving the problem (which he could like the typical PHP developer copy from somewhere else) he did a crappy hack.<|eor|><|sor|>His attitude didn't matter! PHP was a silly little hack to help him and him alone. I can't judge him for mistakes made during that era of its development.<|eor|><|sor|>You really can. There's hacks and there's hacks. Using strlen as a hash function for names of things isn't even that.<|eor|><|soopr|>I feel like it was more work to rename his functions to get an even distribution than to use a better hashing function.<|eoopr|><|eols|><|endoftext|>
19
lolphp
Various_Pickles
ceavbgl
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Even when I was a 17 year-old clueless C hacker I knew how to make a better hash function by adding up the characters of the string. Who on earth thinks strlen() is a hash function?<|eor|><|sor|>17-year-old me may very well have made many of the plainly moronic design choices in PHP. I can, however, honestly say that I wouldn't have stood by them for the next decade(s) ...<|eor|><|eols|><|endoftext|>
18
lolphp
ChoHag
ce3wfha
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>That was before anyone really used it, though.<|eor|><|sor|>The problem here is Rasmus general attitude. When he encountered the problem instead of solving the problem (which he could like the typical PHP developer copy from somewhere else) he did a crappy hack.<|eor|><|sor|>His attitude didn't matter! PHP was a silly little hack to help him and him alone. I can't judge him for mistakes made during that era of its development.<|eor|><|sor|>You really can. There's hacks and there's hacks. Using strlen as a hash function for names of things isn't even that.<|eor|><|eols|><|endoftext|>
18
lolphp
catcradle5
ce4bd3g
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>That was before anyone really used it, though.<|eor|><|sor|>The problem here is Rasmus general attitude. When he encountered the problem instead of solving the problem (which he could like the typical PHP developer copy from somewhere else) he did a crappy hack.<|eor|><|sor|>His attitude didn't matter! PHP was a silly little hack to help him and him alone. I can't judge him for mistakes made during that era of its development.<|eor|><|sor|>You really can. There's hacks and there's hacks. Using strlen as a hash function for names of things isn't even that.<|eor|><|soopr|>I feel like it was more work to rename his functions to get an even distribution than to use a better hashing function.<|eoopr|><|sor|>It must've been. He could've even done a quick AltaVista/Yahoo search for "hash function" or "hash a string" and copied and pasted that. He could've put "how do I hash a string?" into AskJeeves, copied and pasted the first result, and it would've been a trillion times better. He could've copied the incredibly rudimentary hashing function straight out of K&R, which was basically: for (size_t i = 0; i < str.length(); i++) hash = (hash * seed) + str[i]; Instead of doing any of those things, he went and renamed every single function so they had a sparse distribution of string lengths? Seriously? It takes a special kind of stupid to do that.<|eor|><|eols|><|endoftext|>
16
lolphp
xiongchiamiov
ce4cot9
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Wow. It could have taken entire minutes to implement a real hash function, or at very least call out to an existing one <|eor|><|sor|>strlen may be the worst hashing function I have ever heard of. It's one step away from return 0.<|eor|><|sor|>At least `return 0` would have been O(1).<|eor|><|soopr|>[Someone on Hacker News](https://news.ycombinator.com/item?id=6920007) dug up the source, and [it appears](https://dl.dropboxusercontent.com/s/e8k4n2mx1y5vsa4/Zrzut%20ekranu%202013-12-17%2008.37.01.png) the buckets were hard-coded into the language. So, it was faster than having to `strlen()` all the time, but then why the fuck did they need to be by length if he was going to just hard-code them in there?<|eoopr|><|eols|><|endoftext|>
15
lolphp
catcradle5
ce4bezh
<|sols|><|sot|>PHP functions originally bucketed by strlen, were renamed to balance length<|eot|><|sol|>http://news.php.net/php.internals/70691<|eol|><|sor|>Can someone ELI5? All his functions had to have a different length?<|eor|><|sor|>No, but the length of functions names had to be uniformly distributed.<|eor|><|sor|>Why?<|eor|><|sor|>He had all of his namespace in a hash table. To find a function pointer by it's name, he looked it up in the table. A hash table can be implemented by using an array and putting all values in there by creating an integer with a hash function `int index = hash(name)` and using that is the index in the array: `functions[hash(name)] = &function` Because there may be collisions in the hash function so that `hash(a) == hash(b)` you can just store a linked list there instead and just append the new value to that list. a and b would then have the same index and to find the correct function you have to iterate the list and check all values. To ensure that you have the least possible collision you can either choose a good hash function or you do it like Rasmus and choose a very, very bad hash function and change the names until it fits. He changed the function names so that his hash function `strlen` was uniformly distributed and all linked lists in his table were equally long. Don't ever do this.<|eor|><|sor|>The funny part is, if he was able to properly implement a hash table that uses linked lists to handle collisions, how the fuck couldn't he have written or even copied and pasted a better hashing function?<|eor|><|eols|><|endoftext|>
15
lolphp
midir
26inbh
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|eols|><|endoftext|>
142
lolphp
Serialk
chrf7xr
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>Wow. That's definitely my new second favorite PHP joke, after 0x0+2.<|eor|><|eols|><|endoftext|>
35
lolphp
midir
chrzyao
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>I can't. I'm giving up on life, indefinitely. How does this even happen.<|eor|><|sor|>i bet there's a php bug on this that's been neglected for like 5 years, and then closed as WONTFIX without comment.<|eor|><|soopr|>[It *was* reported 5 years ago.](https://bugs.php.net/bug.php?id=50184) It was closed as fixed. The "fix" was to add the note [in the documentation](https://www.php.net/manual/en/function.define.php) that says "Case-insensitive constants are stored as lower-case", by way of explanation. [It was reported again a few days ago](https://bugs.php.net/bug.php?id=67334), which is how I found it. It was closed as "not a bug" on the basis that it's documented.<|eoopr|><|eols|><|endoftext|>
35
lolphp
kasnalin
chrhwqp
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>Wow. That's definitely my new second favorite PHP joke, after 0x0+2.<|eor|><|sor|>god, how does that go? i bet it depends on the php version, doesn't it?<|eor|><|sor|><http://3v4l.org/9hiPo> <https://bugs.php.net/bug.php?id=61095><|eor|><|eols|><|endoftext|>
33
lolphp
allthediamonds
chrewhm
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>I can't. I'm giving up on life, indefinitely. How does this even happen.<|eor|><|eols|><|endoftext|>
25
lolphp
Serialk
chrn31y
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>Wow. That's definitely my new second favorite PHP joke, after 0x0+2.<|eor|><|sor|>god, how does that go? i bet it depends on the php version, doesn't it?<|eor|><|sor|><http://3v4l.org/9hiPo> <https://bugs.php.net/bug.php?id=61095><|eor|><|sor|>good fucking god<|eor|><|sor|>You're missing the best part here: in the update containing the fix for this (5.4 I think) they REINTRODUCED the bug for the 0bxxx notation.<|eor|><|eols|><|endoftext|>
22
lolphp
shillbert
chrqmhm
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>I can't. I'm giving up on life, indefinitely. How does this even happen.<|eor|><|sor|>i bet there's a php bug on this that's been neglected for like 5 years, and then closed as WONTFIX without comment.<|eor|><|sor|>Some people might be relying on this undocumented behavior, so we can never ever change it.<|eor|><|eols|><|endoftext|>
17
lolphp
Lokaltog
chrm061
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>[deleted]<|eor|><|sor|>I don't even know what to say. This is on a whole other level of WTF. It's like they've done everything in their power to make this "feature" as inconsistent and bug-prone as possible.<|eor|><|eols|><|endoftext|>
8
lolphp
allthediamonds
chriglu
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>Wow. That's definitely my new second favorite PHP joke, after 0x0+2.<|eor|><|sor|>god, how does that go? i bet it depends on the php version, doesn't it?<|eor|><|sor|>OP's one, too, varies depending on the PHP version: namely, the notice about duplicating the constant will not contain the actual name of the constant on certain versions. http://3v4l.org/rAKrH<|eor|><|eols|><|endoftext|>
8
lolphp
abcdefgben
chru8eh
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>I'm not even surprised, anymore. Whenever I see a post from this subreddit I just sigh and prepare for the worst. This 'feature' is dumb. PHP is dumb.<|eor|><|eols|><|endoftext|>
6
lolphp
shillbert
chrr3l4
<|sols|><|sot|>define() has an optional third argument that specifies if the constant should be case-insensitive; it has the undocumented side-effect of allowing constants to be redefined, but only if they have at least one capital letter<|eot|><|sol|>http://codepad.org/VDE7Ss1T<|eol|><|sor|>[deleted]<|eor|><|sor|>What? So let me get this straight, the constant name is internally all lowercase, and it's case-insensitive *except* in the define() function, where define will happily create a new constant that shadows the other one if that new constant isn't all lowercase... so you can define any number of variations like bAr and BaR if the third param is false, and they'll all be different, and only variations that aren't already defined will be matched to the case-insensitive constant... aaaah<|eor|><|eols|><|endoftext|>
6
lolphp
Deviltry1
55z1u3
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|eols|><|endoftext|>
140
lolphp
RenaKunisaki
d8fbqgv
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>I like to assume the "dialogue" in the Lisp panel is pronounced "ssssssssssssssssss..." Also: * C++: oops, you only rescued a reference to the princess. Now the castle's been destroyed with her still in it. * Python: `import princess` * Assembly: first you need to figure out what a princess is, what a rescue is, and how to walk. * CSS: the princess is floating in midair beside the castle. * Shell script: rescuing the princess is no problem... unless her name has a space in it, then you just stumble off a cliff. * Android: sorry, rescuing princesses is only supported in the pro version. <|eor|><|eols|><|endoftext|>
42
lolphp
serendependy
d8ezbgf
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>PHP was the only language where the prince saved the princess without any extra complications. Sounds like PHP. Does what it does, and does it well, but you don't tell you friends you're using it.<|eor|><|sor|>Did we read the same comic? PHP was the only language where the Knight didn't even *try* to rescue the princess.<|eor|><|eols|><|endoftext|>
25
lolphp
iheartrms
d8ezyt7
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>[deleted]<|eor|><|sor|>They know of what they write. They must suffer for their art.<|eor|><|eols|><|endoftext|>
23
lolphp
cube-drone
d8ff7a3
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>[Well](http://cube-drone.com/comics/c/ingeniuty-of-sorts), [it's](http://cube-drone.com/comics/c/if-programming-languages-were-vehicles) [an](http://cube-drone.com/comics/c/art-of-war) [easy](http://cube-drone.com/comics/c/ergonomically-sound) [target](http://cube-drone.com/comics/c/fine-art). <|eor|><|eols|><|endoftext|>
19
lolphp
berkes
d8fjs86
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>I like to assume the "dialogue" in the Lisp panel is pronounced "ssssssssssssssssss..." Also: * C++: oops, you only rescued a reference to the princess. Now the castle's been destroyed with her still in it. * Python: `import princess` * Assembly: first you need to figure out what a princess is, what a rescue is, and how to walk. * CSS: the princess is floating in midair beside the castle. * Shell script: rescuing the princess is no problem... unless her name has a space in it, then you just stumble off a cliff. * Android: sorry, rescuing princesses is only supported in the pro version. <|eor|><|sor|>Ruby * By the time the entire program is loaded and starts running, you find `#rescue` was monkeypatched on `Object` by the `ActsAsKnight-gem, and is no longer compatible. <|eor|><|eols|><|endoftext|>
19
lolphp
coredumperror
d8fdar3
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>HAHA LOL It's almost like he wrote a bunch of scenarios and arbitrarily assigned random languages to each one.<|eor|><|sor|>Most of those made perfect sense. The C and JS ones were amusingly accurate, the Lisp one was *hilariously* accurate, and I feel like the PHP would be accurate if I suffered from depression. Thankfully, my code shop is moving away from Drupal, so I don't have to code nearly as much PHP any more! Less chance of hanging. :)<|eor|><|sor|>> the Lisp one was *hilariously* accurate LOL BRACKETS What a *hilariously* original and insightful joke. Nerds are by far the easiest audience to cater to because they will laugh at not only jokes but also facts. <|eor|><|sor|>Right, because facts *cannot* be inherently funny. Obviously.<|eor|><|eols|><|endoftext|>
16
lolphp
coredumperror
d8f5lgx
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>HAHA LOL It's almost like he wrote a bunch of scenarios and arbitrarily assigned random languages to each one.<|eor|><|sor|>Most of those made perfect sense. The C and JS ones were amusingly accurate, the Lisp one was *hilariously* accurate, and I feel like the PHP would be accurate if I suffered from depression. Thankfully, my code shop is moving away from Drupal, so I don't have to code nearly as much PHP any more! Less chance of hanging. :)<|eor|><|eols|><|endoftext|>
15
lolphp
coredumperror
d8f5iqc
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>[deleted]<|eor|><|sor|>You can hate PHP while taking advantage of Wordpress's ease-of-use. It's not like 99% of Wordpress users even know what PHP *is*.<|eor|><|eols|><|endoftext|>
13
lolphp
Deviltry1
d8f01tc
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>PHP was the only language where the prince saved the princess without any extra complications. Sounds like PHP. Does what it does, and does it well, but you don't tell you friends you're using it.<|eor|><|sor|>Did we read the same comic? PHP was the only language where the Knight didn't even *try* to rescue the princess.<|eor|><|sor|>You're right. I read the panel as, "You _have_ rescued the princess... in PHP..." But really, now the comic doesn't make any sense.<|eor|><|soopr|>>But really, now the comic doesn't make any sense. php is lol xdddd what else do you need?<|eoopr|><|eols|><|endoftext|>
12
lolphp
yxpow
d8l68g9
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>I like to assume the "dialogue" in the Lisp panel is pronounced "ssssssssssssssssss..." Also: * C++: oops, you only rescued a reference to the princess. Now the castle's been destroyed with her still in it. * Python: `import princess` * Assembly: first you need to figure out what a princess is, what a rescue is, and how to walk. * CSS: the princess is floating in midair beside the castle. * Shell script: rescuing the princess is no problem... unless her name has a space in it, then you just stumble off a cliff. * Android: sorry, rescuing princesses is only supported in the pro version. <|eor|><|sor|>Android: You need to rescue the princess based on whether she's in the castle yet. The princess can only be in the castle when `onPrincessInCastle` is called, but it crashes because you accidentally implemented the core Android version rather than the support library version and you're using a Samsung device which will cause it to crash anyway.<|eor|><|eols|><|endoftext|>
10
lolphp
FweeSpeech
d8f3epl
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>[deleted]<|eor|><|sor|>They know of what they write. They must suffer for their art.<|eor|><|sor|>So you are saying I have to write in PHP for the rest of my life so I know how to subscribe to /r/lolphp? *hangs self*<|eor|><|eols|><|endoftext|>
9
lolphp
marishtar
d8fste1
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>HAHA LOL It's almost like he wrote a bunch of scenarios and arbitrarily assigned random languages to each one.<|eor|><|sor|>Most of those made perfect sense. The C and JS ones were amusingly accurate, the Lisp one was *hilariously* accurate, and I feel like the PHP would be accurate if I suffered from depression. Thankfully, my code shop is moving away from Drupal, so I don't have to code nearly as much PHP any more! Less chance of hanging. :)<|eor|><|sor|>> the Lisp one was *hilariously* accurate LOL BRACKETS What a *hilariously* original and insightful joke. Nerds are by far the easiest audience to cater to because they will laugh at not only jokes but also facts. <|eor|><|sor|>Congratulations. You don't find a joke funny. You have proven yourself to be cool.<|eor|><|eols|><|endoftext|>
8
lolphp
n0t0ri0us9
d8f2hqx
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>PHP was the only language where the prince saved the princess without any extra complications. Sounds like PHP. Does what it does, and does it well, but you don't tell you friends you're using it.<|eor|><|sor|>Did we read the same comic? PHP was the only language where the Knight didn't even *try* to rescue the princess.<|eor|><|sor|>You're right. I read the panel as, "You _have_ rescued the princess... in PHP..." But really, now the comic doesn't make any sense.<|eor|><|sor|>>now the comic doesn't make any sense. Yes. It should be something like. "You have to rescue the princess in Php. You go to the castle and *think* you have rescued the princess and comeback quick. But when you look back, there is no princess". Next time. You go to the castle and think you have rescued the princess. You spend the next week, writing unit tests to make sure you have the princess. Then you come back. But when you look, no princess. Next time. You go to the castle, think you have rescued the princess. Spend the next two weeks write tests to make sure that the princess can survive the journey back. Then come back..When you look back, no princess... ... ... ... Lastly, you use Php7, You go to the castle, think you have rescued the princess. Spend the next two weeks type hinting for the type of princess. Then come back twice as fast..When you look back, [no princess](https://www.reddit.com/r/PHP/comments/41bm7j/new_rfc_allow_specifying_keys_in_list/cz1qnca)... You kill yourself. <|eor|><|eols|><|endoftext|>
8
lolphp
wonderb0lt
d8fmnvk
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>HAHA LOL It's almost like he wrote a bunch of scenarios and arbitrarily assigned random languages to each one.<|eor|><|sor|>Most of those made perfect sense. The C and JS ones were amusingly accurate, the Lisp one was *hilariously* accurate, and I feel like the PHP would be accurate if I suffered from depression. Thankfully, my code shop is moving away from Drupal, so I don't have to code nearly as much PHP any more! Less chance of hanging. :)<|eor|><|sor|>> the Lisp one was *hilariously* accurate LOL BRACKETS What a *hilariously* original and insightful joke. Nerds are by far the easiest audience to cater to because they will laugh at not only jokes but also facts. <|eor|><|sor|>Right, because facts *cannot* be inherently funny. Obviously.<|eor|><|sor|>Like PHP<|eor|><|eols|><|endoftext|>
8
lolphp
zz_zzz
d8f02ck
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>PHP was the only language where the prince saved the princess without any extra complications. Sounds like PHP. Does what it does, and does it well, but you don't tell you friends you're using it.<|eor|><|sor|>Did we read the same comic? PHP was the only language where the Knight didn't even *try* to rescue the princess.<|eor|><|sor|>You're right. I read the panel as, "You _have_ rescued the princess... in PHP..." But really, now the comic doesn't make any sense.<|eor|><|soopr|>>But really, now the comic doesn't make any sense. php is lol xdddd what else do you need?<|eoopr|><|sor|>[XDDDD](http://i2.kym-cdn.com/photos/images/newsfeed/000/923/668/d83.png)<|eor|><|eols|><|endoftext|>
8
lolphp
carlos_vini
d8fnnzl
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>[Well](http://cube-drone.com/comics/c/ingeniuty-of-sorts), [it's](http://cube-drone.com/comics/c/if-programming-languages-were-vehicles) [an](http://cube-drone.com/comics/c/art-of-war) [easy](http://cube-drone.com/comics/c/ergonomically-sound) [target](http://cube-drone.com/comics/c/fine-art). <|eor|><|sor|>I hope i'm not the only one here that prefers Garfield over the other 2 options: http://cube-drone.com/comics/c/fine-art<|eor|><|eols|><|endoftext|>
6
lolphp
iheartrms
d8f00cl
<|sols|><|sot|>Even comics make fun of PHP<|eot|><|sol|>https://toggl.com/programming-princess<|eol|><|sor|>PHP was the only language where the prince saved the princess without any extra complications. Sounds like PHP. Does what it does, and does it well, but you don't tell you friends you're using it.<|eor|><|sor|>> but you don't tell you friends you're using it. So PHP is like riding a moped or fucking a fat chick?<|eor|><|eols|><|endoftext|>
6
lolphp
Takeoded
8yicdo
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|eols|><|endoftext|>
139
lolphp
rinyre
e2bq6xh
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|sor|>Finally an actual lolphp<|eor|><|eols|><|endoftext|>
25
lolphp
Miserable_Fuck
e2bz4rj
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|sor|>god fucking dammit...why??<|eor|><|eols|><|endoftext|>
22
lolphp
duskwuff
e2c3srg
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|sor|>god fucking dammit...why??<|eor|><|sor|>I haven't investigated in detail, but my first inclination would be to blame [libgd](https://libgd.github.io/). It's a kind of old and crusty library, and I wouldn't be surprised at all if it sometimes failed silently when writing files.<|eor|><|eols|><|endoftext|>
17
lolphp
duskwuff
e2cmcns
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|sor|>god fucking dammit...why??<|eor|><|sor|>I haven't investigated in detail, but my first inclination would be to blame [libgd](https://libgd.github.io/). It's a kind of old and crusty library, and I wouldn't be surprised at all if it sometimes failed silently when writing files.<|eor|><|sor|>`libgd` has one of the worst APIs I've ever seen in my life. I *so* much prefer ImageMagick.<|eor|><|sor|>IM is not awesome either. They're really made for two different sets of tasks: GD is for drawing simple graphics; IM is for manipulating images. Neither one is especially great at its own task, and is outright awful at anything else.<|eor|><|eols|><|endoftext|>
10
lolphp
The_Sly_Marbo
e2d7c3d
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|sor|>PHP: "except when it doesn't"<|eor|><|eols|><|endoftext|>
8
lolphp
calligraphic-io
e2cj6sr
<|sols|><|sot|>imagegd2: returns TRUE on success, and FALSE on failure ... or TRUE on failure.<|eot|><|sol|>http://php.net/manual/en/function.imagegd2.php<|eol|><|sor|>god fucking dammit...why??<|eor|><|sor|>I haven't investigated in detail, but my first inclination would be to blame [libgd](https://libgd.github.io/). It's a kind of old and crusty library, and I wouldn't be surprised at all if it sometimes failed silently when writing files.<|eor|><|sor|>`libgd` has one of the worst APIs I've ever seen in my life. I *so* much prefer ImageMagick.<|eor|><|eols|><|endoftext|>
6
lolphp
esquilax
2dkq2f
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|eols|><|endoftext|>
138
lolphp
willfe42
cjqk6w9
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>[deleted]<|eor|><|sor|>Wait, _what?_ Is that for real? This ... suddenly makes quite a few bad PHP projects I've seen make a lot more sense.<|eor|><|eols|><|endoftext|>
36
lolphp
cparen
cjqh4cz
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>> Why can't they write their own sensibly-named wrapper functions if it's so bad? Why can't the language get it right, like *any* other *designed* language out there?<|eor|><|sor|>True, but keep in mind that PHP never in its history hinted at being "well designed". Even the name was a giant red flag: "Personal Home Page", as in, one guy's personal hobby project. PHP is the proper reward/punishment for anyone choosing to use PHP.<|eor|><|eols|><|endoftext|>
30
lolphp
fnzp
cjqeioo
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|eols|><|endoftext|>
22
lolphp
muyuu
cjqvyi7
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>Rasmus was so incredibly reckless and noobish, it defies belief PHP went on to be so successful. Seriously, instead of looking for a decent hash function he randomly fiddled with function names. It makes absolutely no sense and it's actually more work than looking for a semi-decent hash functions (this was the mid 90s, plenty of stuff available online very readily).<|eor|><|eols|><|endoftext|>
22
lolphp
callcifer
cjqemzg
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>> Why can't they write their own sensibly-named wrapper functions if it's so bad? Why can't the language get it right, like *any* other *designed* language out there?<|eor|><|eols|><|endoftext|>
20
lolphp
esquilax
cjqkryv
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>> Why can't they write their own sensibly-named wrapper functions if it's so bad? Why can't the language get it right, like *any* other *designed* language out there?<|eor|><|sor|>True, but keep in mind that PHP never in its history hinted at being "well designed". Even the name was a giant red flag: "Personal Home Page", as in, one guy's personal hobby project. PHP is the proper reward/punishment for anyone choosing to use PHP.<|eor|><|soopr|>Pretty Hard Punishment.<|eoopr|><|eols|><|endoftext|>
20
lolphp
Drainedsoul
cjqq82o
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>[deleted]<|eor|><|sor|>Wait, _what?_ Is that for real? This ... suddenly makes quite a few bad PHP projects I've seen make a lot more sense.<|eor|><|sor|>How else do you explain [`func_get_args`](http://php.net/manual/en/function.func-get-args.php) and friends?<|eor|><|eols|><|endoftext|>
11
lolphp
willfe42
cjqvy9w
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>[deleted]<|eor|><|sor|>Wait, _what?_ Is that for real? This ... suddenly makes quite a few bad PHP projects I've seen make a lot more sense.<|eor|><|sor|>How else do you explain [`func_get_args`](http://php.net/manual/en/function.func-get-args.php) and friends?<|eor|><|sor|>Good drugs?<|eor|><|eols|><|endoftext|>
10
lolphp
__constructor
cjri89i
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>Rasmus was so incredibly reckless and noobish, it defies belief PHP went on to be so successful. Seriously, instead of looking for a decent hash function he randomly fiddled with function names. It makes absolutely no sense and it's actually more work than looking for a semi-decent hash functions (this was the mid 90s, plenty of stuff available online very readily).<|eor|><|sor|>He also thought memory leaks were perfectly acceptable and just restarting a server function when the pool gets too big is OK. Makes me very glad there's better minded people in internals these days.<|eor|><|eols|><|endoftext|>
9
lolphp
Banane9
cjru4cp
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>> Why can't they write their own sensibly-named wrapper functions if it's so bad? Why can't the language get it right, like *any* other *designed* language out there?<|eor|><|sor|>True, but keep in mind that PHP never in its history hinted at being "well designed". Even the name was a giant red flag: "Personal Home Page", as in, one guy's personal hobby project. PHP is the proper reward/punishment for anyone choosing to use PHP.<|eor|><|soopr|>Pretty Hard Punishment.<|eoopr|><|sor|>PHP has Problems<|eor|><|eols|><|endoftext|>
9
lolphp
Drainedsoul
cjqs524
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>[deleted]<|eor|><|sor|>Wait, _what?_ Is that for real? This ... suddenly makes quite a few bad PHP projects I've seen make a lot more sense.<|eor|><|sor|>How else do you explain [`func_get_args`](http://php.net/manual/en/function.func-get-args.php) and friends?<|eor|><|sor|>[deleted]<|eor|><|sor|>Exactly, which is why `func_get_args` existed before PHP 5.6. This isn't just lolphp though, it's also loljavascript, which does something similar.<|eor|><|eols|><|endoftext|>
8
lolphp
amunak
cjr0yyd
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>[deleted]<|eor|><|sor|>Wait, _what?_ Is that for real? This ... suddenly makes quite a few bad PHP projects I've seen make a lot more sense.<|eor|><|sor|>How else do you explain [`func_get_args`](http://php.net/manual/en/function.func-get-args.php) and friends?<|eor|><|sor|>[deleted]<|eor|><|sor|>Exactly, which is why `func_get_args` existed before PHP 5.6. This isn't just lolphp though, it's also loljavascript, which does something similar.<|eor|><|sor|>Javascript doesn't obfuscate that fact, though.<|eor|><|eols|><|endoftext|>
7
lolphp
Drainedsoul
cjqwmy7
<|sols|><|sot|>"Im crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor<|eot|><|sol|>http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my<|eol|><|sor|>People complaining about wacky function names! Why can't they write their own sensibly-named wrapper functions if it's so bad? Lolphp that's why.<|eor|><|sor|>[deleted]<|eor|><|sor|>Wait, _what?_ Is that for real? This ... suddenly makes quite a few bad PHP projects I've seen make a lot more sense.<|eor|><|sor|>How else do you explain [`func_get_args`](http://php.net/manual/en/function.func-get-args.php) and friends?<|eor|><|sor|>Good drugs?<|eor|><|sor|>Or really bad ones...<|eor|><|eols|><|endoftext|>
6
lolphp
ssmm987
3gyixs
<|sols|><|sot|>This should *never* happen!<|eot|><|sol|>http://i.imgur.com/Y9Mi8QX.png<|eol|><|eols|><|endoftext|>
134
lolphp
polish_niceguy
cu2mrz8
<|sols|><|sot|>This should *never* happen!<|eot|><|sol|>http://i.imgur.com/Y9Mi8QX.png<|eol|><|sor|>At least someone coded for the "should never happen" scenario. Someone there has a working brain, there is hope.<|eor|><|eols|><|endoftext|>
65