subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
lolphp
orbital1337
dhyehfu
<|sols|><|sot|>Why is this allowed? (Inverse inheritance)<|eot|><|sol|>https://3v4l.org/qLedW<|eol|><|sor|>Why shouldn't it be? There are some situations where a parent class might want to call something in a child. The most common would be overridden methods. Would you prefer it if they were a special case?<|eor|><|sor|>The weird thing is that `protected` methods are usually only supposed to be callable by objects which inherit from the base class that defines that method.<|eor|><|eols|><|endoftext|>
6
lolphp
jesseschalken
dibsmvq
<|sols|><|sot|>Why is this allowed? (Inverse inheritance)<|eot|><|sol|>https://3v4l.org/qLedW<|eol|><|sor|>The reason for this is that if you have abstract class A { protected abstract protected function bar(); public function foo() { echo $this->bar(); } } class B extends A { protected function bar() { return 'Hello'; } } (new B())->foo(); it should work. `A` can require or allow subclasses to override methods without exposing them outside the class hierarchy by marking them as `protected`, but a consequence of that is that `A` must be able to call protected methods in subclasses. In reality `protected` visibility doesn't guarantee much if anything, since anybody can call your protected method by making their class extend yours (or routing the call through a static method in a dummy class that extends yours). It's somewhat of a broken feature, and it can't work properly without a concept of package visibility which doesn't exist, so I wouldn't worry too much about it.<|eor|><|soopr|>> In reality protected visibility doesn't guarantee much if anything, since anybody can call your protected method by making their class extend yours It's like you've never heard of `final`.<|eoopr|><|sor|>Doesn't help because the base class defining the `protected` method (to be called/overridden/implemented by sub classes) obviously can't be `final`. Example: https://3v4l.org/PbURf<|eor|><|eols|><|endoftext|>
5
lolphp
mtantawy
5oiftm
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|eols|><|endoftext|>
29
lolphp
stumpychubbins
dck6yz2
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>"They'll work with the single-byte UTF-8 chars, but not the multi-byte ones." Oh.<|eor|><|sor|>Well we congratulate them for reaching UTF8 support parity with systems released before the existence of UTF8.<|eor|><|eols|><|endoftext|>
37
lolphp
Matt3k
dcjj5t4
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>"They'll work with the single-byte UTF-8 chars, but not the multi-byte ones." Oh.<|eor|><|eols|><|endoftext|>
36
lolphp
SituationSoap
dcjsfmp
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>> Switch to dollars or fix your LOCALE. Come on guys, Rasmus solved this problem six years ago. Just switch to dollars! <|eor|><|eols|><|endoftext|>
34
lolphp
the_alias_of_andrea
dcjoccn
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>Yes. Because they don't in C. If you want to inspect UTF-8 characters, there's the `IntlChar` class. Alas, C doesn't understand multibyte characters for the most part. PHP has inherited that legacy.<|eor|><|eols|><|endoftext|>
26
lolphp
emilvikstrom
dcjts06
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>This is of course not documented anywhere. A shame too since the ctype functions used to be the best ones for this (in a pre-Unicode world). ctype_digit is Inf more useful than is_number.<|eor|><|eols|><|endoftext|>
9
lolphp
mtantawy
dcjhsjy
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|soopr|>INB4 this link is from 2010, i still have similar problem now using php7.0 and 7.1 as well.<|eoopr|><|eols|><|endoftext|>
9
lolphp
mtantawy
dcjsw61
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>deleted ^^^^^^^^^^^^^^^^0.1907 [^^^What ^^^is ^^^this?](https://pastebin.com/FcrFs94k/34434)<|eor|><|soopr|>Similar issue on PHP7.0 and PHP7.1 today.<|eoopr|><|eols|><|endoftext|>
9
lolphp
mtantawy
dcjm1lo
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>"They'll work with the single-byte UTF-8 chars, but not the multi-byte ones." Oh.<|eor|><|soopr|>http://weknowmemes.com/wp-content/uploads/2012/02/fuck-that-bitch-yao-pff.png <|eoopr|><|eols|><|endoftext|>
8
lolphp
ennorehling
dcjmbkb
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>It's 2017, and programmers still don't understand character encodings.<|eor|><|eols|><|endoftext|>
7
lolphp
jesseschalken
dcw7xf0
<|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>The "ctype" functions are wrappers for the C functions in [`ctype.h`](http://www.cplusplus.com/reference/cctype/). They won't be upgraded to Unicode support for the same reason the corresponding C functions won't - backwards compatibility. If you want to check characters outside the ASCII range don't use them.<|eor|><|eols|><|endoftext|>
6
lolphp
pilif
56y1sl
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|eols|><|endoftext|>
32
lolphp
SirClueless
d8o1ync
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Because PHP's arrays are dual-purpose, there are usually two approaches to array manipulations. This isn't especially surprising.<|eor|><|sor|>For you.<|eor|><|sor|>No, it's unsurprising if you actually use PHP. This essentially amounts to laughing at PHP's array type, which may or may not be worthwhile, but call it what it is.<|eor|><|sor|>> This essentially amounts to laughing at PHP's array type, which may or may not be worthwhile, but call it what it is. OK, I'm laughing at PHP's array type. Happy?<|eor|><|eols|><|endoftext|>
22
lolphp
SnowdogU77
d8nlym5
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>This is a well known "feature" and (as usual) kindly mentioned in documentation<|eor|><|sor|>Ah yes, the classic PHP dilemma. In the words of our founding fathers, "Just because it's documented doesn't mean it's right."<|eor|><|eols|><|endoftext|>
20
lolphp
sloat
d8nqddx
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>This is a well known "feature" and (as usual) kindly mentioned in documentation<|eor|><|sor|>Correct. The documentation states: Numeric keys will be renumbered. Numeric... https://3v4l.org/M61vV<|eor|><|eols|><|endoftext|>
18
lolphp
BilgeXA
d8nlrfb
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Because PHP's arrays are dual-purpose, there are usually two approaches to array manipulations. This isn't especially surprising.<|eor|><|sor|>For you.<|eor|><|eols|><|endoftext|>
18
lolphp
inopia
d8oct4b
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Because PHP's arrays are dual-purpose, there are usually two approaches to array manipulations. This isn't especially surprising.<|eor|><|sor|>For you.<|eor|><|sor|>Well, it would be surprising if you expected it to preserve numeric keys. If I have two separate arrays that were populated by simply pushing items onto it without specifying a key, both of them would have keys ranging from 0 to the array lengths. That means that there will be key collisions. Trying to preserve keys would actually violate least surprise in this case, since it would involve overwriting data as if they were string keys even though someone using this is probably trying to treat it as a standard array rather than a hash map. EDIT: On reflection, it may be less surprising to have an `array_merge` that preserves keys whether or not they are numeric or string and something like `array_concat`, a function that preserves values in the same way array_merge currently does with numeric arrays. However, I am not sure what behavior would be least surprising with regards to string keys. Really, most of the problem here is the whole Its a hash map, but well pretend its an array, thing.<|eor|><|sor|>> Well, it would be surprising if you expected it to preserve numeric keys isn't that what 'merge' means? > If I have two separate arrays that were populated by simply pushing items onto it without specifying a key, both of them would have keys ranging from 0 to the array lengths. That means that there will be key collisions. that's why most languages have a way to do array concatenation. It's a completely different operation. > Trying to preserve keys would actually violate least surprise in this case, since it would involve overwriting data as if they were string keys even though someone using this is probably trying to treat it as a standard array rather than a hash map. You seem to be making very strange assumptions about what a programmer wants. Most programmers I know want predictable behavior out of their standard libraries. A merge should be a goddamn merge, not a concatenation. Imagine when you go to a bar and you order a beer, and the bartender brings out a camel. And you ask him, why the fuck are you bringing me a camel? And then he says, 'when you called me over, you used your left hand, and you are not wearing a hat'. That's how fucking illogical PHP is.<|eor|><|eols|><|endoftext|>
16
lolphp
nazar-pc
d8nbd7e
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>This is a well known "feature" and (as usual) kindly mentioned in documentation<|eor|><|eols|><|endoftext|>
13
lolphp
bwoebi
d98cagb
<|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Just for the record, `[] + [1234 => true]` will do what you expect.<|eor|><|eols|><|endoftext|>
6
lolphp
whatsaret
2x84jn
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|eoss|><|endoftext|>
32
lolphp
cfreak2399
coxr9h8
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>I hate coding in it but I still do when someone pays me to do so. I dislike people who think it's good and refuse to learn anything else. I dislike the core internals developers who seem pretty toxic. Most of all I enjoy making fun of the quirks. <|eor|><|eoss|><|endoftext|>
57
lolphp
nick_danger
coxsurv
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>I hate coding in it but I still do when someone pays me to do so. I dislike people who think it's good and refuse to learn anything else. I dislike the core internals developers who seem pretty toxic. Most of all I enjoy making fun of the quirks. <|eor|><|sor|>Around my office we have a term for that: "billable hate." When it's a tool in your tool belt, and the customer needs you to do something using that tool, you just suck it up and deal with it. Sure, I'd rather be working in other technology platforms for all the reasons the Fractal of Bad Design blog post lists, but at the end of the day, if you're really careful, you can produce some decent code with PHP. The trouble is the level of effort required to be careful with PHP just feels a lot higher than with other technologies. So do I hate it? Depends on how much the customer is willing to spend. <|eor|><|eoss|><|endoftext|>
24
lolphp
allthediamonds
coxqosq
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>"Hate" is quite a meaningless term to discuss programming languages. PHP is broken. There are a lot of things wrong with it, from the way the language and its standard libraries are designed to break easily (and take your whole application with it) to the development culture that consistently delivers hopelessly broken projects without the slightest bit of self-awareness. I don't hate PHP, but I find its pervasiveness to be frustrating and its continued existence and maintenance to be a curse on programming as a skill and as a community.<|eor|><|eoss|><|endoftext|>
23
lolphp
xiongchiamiov
coxxmh1
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>Yes. It is a terrible language. "Quirkiness" gets in the way of your job. You can either memorize countless "quirks", exceptions, edge cases, and arbitrary differences, or work in a language that makes sense.<|eor|><|sor|>https://en.wikipedia.org/wiki/Principle_of_least_astonishment<|eor|><|eoss|><|endoftext|>
20
lolphp
ioctl79
coxu3pj
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>Yes. It is a terrible language. "Quirkiness" gets in the way of your job. You can either memorize countless "quirks", exceptions, edge cases, and arbitrary differences, or work in a language that makes sense.<|eor|><|eoss|><|endoftext|>
19
lolphp
madsohm
coxv7ii
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>A lot of bad decisions have been made regarding PHP as a language. The fact that people still, to this day, write `mysql_real_escape_string` because `mysql_escape_string` is broken, is laughable. I don't *hate* PHP, I just avoid it - and laugh at it. It's important to note that I don't laugh at the developers who use PHP. It's the language that is laughable. The good programmers in the PHP world try hard to avoid all the quirks, and do proper development and tooling with it. We have a saying where I work: "Choose the right tool for the job". You might be able to hammer a nail with a screwdriver or even embed a screw in the wall with a hammer, but it would be easier and more pleasent for everyone, if you used a hammer for the nail and a screwdriver for the screw.<|eor|><|eoss|><|endoftext|>
18
lolphp
PasswordIsntHAMSTER
coxxy1k
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>I hate coding in it but I still do when someone pays me to do so. I dislike people who think it's good and refuse to learn anything else. I dislike the core internals developers who seem pretty toxic. Most of all I enjoy making fun of the quirks. <|eor|><|sor|>Around my office we have a term for that: "billable hate." When it's a tool in your tool belt, and the customer needs you to do something using that tool, you just suck it up and deal with it. Sure, I'd rather be working in other technology platforms for all the reasons the Fractal of Bad Design blog post lists, but at the end of the day, if you're really careful, you can produce some decent code with PHP. The trouble is the level of effort required to be careful with PHP just feels a lot higher than with other technologies. So do I hate it? Depends on how much the customer is willing to spend. <|eor|><|sor|>I feel like it's difficult enough to produce decent code (for some definition of "decent") in *any* language, I don't need PHP to make it worse for me. I think the worst languages I'd be willing to program in professionally are something like Python or Ruby. MAYBE Java if I have a big flock of grunts to order around; MAYBE Node.js if the team is really solid. Sure, if the choice is between starving and PHP I'll pick PHP, but there's no reason to make your work life any more complicated than it needs to be.<|eor|><|sor|>Out of curiosity, what does the rest of your "good" list look like?<|eor|><|sor|>F# at the top, C#, Ocaml and C++ slightly lower, then Haskell, Python and Rust, then Ruby and Scala. Pascal gets an honorary spot because it used to be cool. Go, Node.js, C and Java don't make it to the "good" list, but they're reasonably usable. PHP hangs out at the the very bottom, with Visual Basic and what not. This list is 100% "what works for me" in the context of non-trivial networked applications. It's as devoid of ideology as I can make it. There's some languages I haven't given a fair shake to, like Clojure and Perl for example. My list would be different in the context of pure webdev - Haskell and Ocaml would go way down, Python, Ruby and Node.js way up. E: Basically, * F#'s biggest flaw is having NO JOB MARKET WHATSOEVER LOL * Ocaml suffers from its shitty build system, small ecosystem, and lack of tooling. * C# is very expressive but has no sum types. * C++ is full of cruft, easy to misuse, but very powerful and expressive. * Haskell... I'm not even going to get started, it's a very cool language but holy shit the caveats are deadly. ` type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t` WHAT THE FUCK * Python is neat, but NO STATIC TYPES?!?!?!? and the metamagic is too strong. * Ruby people don't subscribe to basic software engineering principles. (Something which is also found in the Node.js and PHP communities.) * Pascal is like a worse C with better syntax (YES I WENT THERE.) * Rust looks like the second coming, but it's still too immature. * I love to talk shit about Scala because to me it looks like someone tried to write a functional programming language while having no idea of how to do effective functional programming, but really it's not THAT bad. * Java is incredibly inexpressive, the library APIs suck, particularly compared to .NET. * Node.js and Go both suffer from having a shitty error-handling mechanism. Furthermore, Node.js desperately needs a special syntax for continuation monads. Also Go has NO GENERICS LOL TL;DR everything sucks<|eor|><|eoss|><|endoftext|>
18
lolphp
captainramen
coxulrw
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>If it were a choice between programming only in PHP or working in retail, i'd work in retail.<|eor|><|eoss|><|endoftext|>
16
lolphp
ZugNachPankow
coxqnow
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>It's not about developers fucking up their own code, but rather about PHP itself being broken. Myself, I don't hate PHP, it's just a "dirty and quick" solution. It could work for simple applications, but there's no way I would use it in a sufficiently large enterprise.<|eor|><|eoss|><|endoftext|>
14
lolphp
thallippoli
coxsqwg
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>Telling 'PHP is an ok language' to someone starting in programming is as subtle and as damaging a lie as telling, looks does not matter, to an ugly kid. It blocks a lot of learning and causes all kinds of unnecessary pain.. Saying that you can do everything in it is like saying everything with four wheels can be driven like a Porsche.. But what I hate the most about PHP is the people who blindly keep using it and 'love it' for what ever reasons, despite acknowledging its 'quirks' and availability of better alternatives. EDIT:I was working a professional PHP programmer for the past 9 years... <|eor|><|eoss|><|endoftext|>
12
lolphp
PasswordIsntHAMSTER
coxtsfl
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>I hate coding in it but I still do when someone pays me to do so. I dislike people who think it's good and refuse to learn anything else. I dislike the core internals developers who seem pretty toxic. Most of all I enjoy making fun of the quirks. <|eor|><|sor|>Around my office we have a term for that: "billable hate." When it's a tool in your tool belt, and the customer needs you to do something using that tool, you just suck it up and deal with it. Sure, I'd rather be working in other technology platforms for all the reasons the Fractal of Bad Design blog post lists, but at the end of the day, if you're really careful, you can produce some decent code with PHP. The trouble is the level of effort required to be careful with PHP just feels a lot higher than with other technologies. So do I hate it? Depends on how much the customer is willing to spend. <|eor|><|sor|>I feel like it's difficult enough to produce decent code (for some definition of "decent") in *any* language, I don't need PHP to make it worse for me. I think the worst languages I'd be willing to program in professionally are something like Python or Ruby. MAYBE Java if I have a big flock of grunts to order around; MAYBE Node.js if the team is really solid. Sure, if the choice is between starving and PHP I'll pick PHP, but there's no reason to make your work life any more complicated than it needs to be.<|eor|><|eoss|><|endoftext|>
12
lolphp
implicit_cast
coxy8ic
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>It bothers me that millions of man-hours are wasted on problems that have absolutely nothing to do with the needs of the customers who are paying for those man-hours.<|eor|><|eoss|><|endoftext|>
11
lolphp
_vec_
coy7zlr
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>Telling 'PHP is an ok language' to someone starting in programming is as subtle and as damaging a lie as telling, looks does not matter, to an ugly kid. It blocks a lot of learning and causes all kinds of unnecessary pain.. Saying that you can do everything in it is like saying everything with four wheels can be driven like a Porsche.. But what I hate the most about PHP is the people who blindly keep using it and 'love it' for what ever reasons, despite acknowledging its 'quirks' and availability of better alternatives. EDIT:I was working a professional PHP programmer for the past 9 years... <|eor|><|soopr|>Alright well I like it, I don't love it, I'm just used to it and stuff like flask looks really weird, I also dislike ruby/RoR<|eoopr|><|sor|>Flask and Rails "look really weird" because you are used to PHP. PHP is designed with the explicit goal of making getting off the ground as easy as possible. You can drop your code straight into HTML, trust the language to convert all your data to whatever types you need, pull your input out of magic global variables wherever you happen to need it, and then let Apache manage your process for you. All of these make getting a simple project started easier. Those are all terrible ideas in the long run, and most of them are difficult or impossible to move away from when they do become painful. Other frameworks (including both Flask and Rails, among many others) generally don't do that. They force you to do it right from the beginning, where right is defined as the way that will give you the least trouble when your app has grown large or complicated or popular. Unfortunately, the PHP way really is easier in the simplest cases. The value of the "weird" approaches are really only evident as a project grows, which makes them hard to explain concisely or to show in an easy to understand example. And that's why I, for one, hate PHP. Knowing PHP actively discourages people from learning the tools and techniques that would make their lives easier and their code better.<|eor|><|eoss|><|endoftext|>
10
lolphp
allthediamonds
coy8mf6
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>"Hate" is quite a meaningless term to discuss programming languages. PHP is broken. There are a lot of things wrong with it, from the way the language and its standard libraries are designed to break easily (and take your whole application with it) to the development culture that consistently delivers hopelessly broken projects without the slightest bit of self-awareness. I don't hate PHP, but I find its pervasiveness to be frustrating and its continued existence and maintenance to be a curse on programming as a skill and as a community.<|eor|><|sor|>[deleted]<|eor|><|sor|>The only reason it's easy to run is because mainstream distros come with an Apache installation and mod_php built in. It's a self-fulfilling prophecy! As anyone who has ever had to edit a php.ini file or configure nginx+fpm will tell you, there's nothing *easy* about setting up a PHP environment except when someone has already done it for you. And, well, about your questions, I find the pervasiveness of something I consider to be a bad thing to be frustrating. Watching lots of people get riled by a poisonous development culture and praise the benefits of a language which is ten years behind its contemporaries makes me want to use the word "sheeple" non-ironically.<|eor|><|eoss|><|endoftext|>
9
lolphp
cjwelborn
coxxfip
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>"Hate" is too strong. I find it really "odd". I look at it in the same way people look at car accidents as they're driving by. I wouldn't like to be involved in either. I often wonder what would make a person decide to start working on the PHP-dev team. I don't know why they find it odd when someone decides to leave the team. This quote from [PHP: a fractal of bad design](http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/): >PHP is a community of amateurs. [...snipped...] >Those who do grow a clue tend to drift away to other platforms, reducing the average competence of the whole. I would never "hate" anyone for the language they use, or "hate" a language itself. It just raises a lot of questions for me.<|eor|><|eoss|><|endoftext|>
8
lolphp
allthediamonds
cp12uby
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>If it were a choice between programming only in PHP or working in retail, i'd work in retail.<|eor|><|sor|>Enjoy that pay cut edit: Downvoted? You guys go work in retail and tell me you aren't making a lot less money for way more work.<|eor|><|sor|>Lol. As if the average php dev made that much more than a retail employee. With about the same level of frustration.<|eor|><|sor|>> With about the same level of frustration. You wish! Unlike PHP, the physical world is consistent and predictable. There's no way in which the physical world can, say, accept its arguments in any order and make it so that you accidentally put the shelf on the items instead of the other way around.<|eor|><|eoss|><|endoftext|>
8
lolphp
allthediamonds
cp12sdt
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>It's not about developers fucking up their own code, but rather about PHP itself being broken. Myself, I don't hate PHP, it's just a "dirty and quick" solution. It could work for simple applications, but there's no way I would use it in a sufficiently large enterprise.<|eor|><|sor|>>It could work for simple applications, but there's no way I would use it in a sufficiently large enterprise. Like Facebook? Would php work for a site the size of Facebook? <|eor|><|sor|>http://en.wikipedia.org/wiki/Programming_languages_used_in_most_popular_websites<|eor|><|sor|>No amount of type juggling in the world can make it so that popularity equals quality.<|eor|><|eoss|><|endoftext|>
8
lolphp
Banane9
cozultq
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>It's not about developers fucking up their own code, but rather about PHP itself being broken. Myself, I don't hate PHP, it's just a "dirty and quick" solution. It could work for simple applications, but there's no way I would use it in a sufficiently large enterprise.<|eor|><|sor|>>It could work for simple applications, but there's no way I would use it in a sufficiently large enterprise. Like Facebook? Would php work for a site the size of Facebook? <|eor|><|sor|>And Facebook rewrote PHP to do it ...<|eor|><|eoss|><|endoftext|>
7
lolphp
allthediamonds
coy8xin
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>"Hate" is quite a meaningless term to discuss programming languages. PHP is broken. There are a lot of things wrong with it, from the way the language and its standard libraries are designed to break easily (and take your whole application with it) to the development culture that consistently delivers hopelessly broken projects without the slightest bit of self-awareness. I don't hate PHP, but I find its pervasiveness to be frustrating and its continued existence and maintenance to be a curse on programming as a skill and as a community.<|eor|><|sor|>[deleted]<|eor|><|sor|>Not really. Many hosting providers only provide old versions so unless you code for 5.2 you aren't guaranteed your code will run and if you need newer features you often need to compile it yourself. Its not hard, but it's a pain and it's definitely not just click and run anywhere.<|eor|><|sor|>[deleted]<|eor|><|sor|>More importantly, why are you even using shared hosting on 2015? Get a $20/year VPS like everyone else.<|eor|><|eoss|><|endoftext|>
7
lolphp
allthediamonds
coy95kc
<|soss|><|sot|>A question<|eot|><|sost|>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<|eost|><|sor|>A lot of bad decisions have been made regarding PHP as a language. The fact that people still, to this day, write `mysql_real_escape_string` because `mysql_escape_string` is broken, is laughable. I don't *hate* PHP, I just avoid it - and laugh at it. It's important to note that I don't laugh at the developers who use PHP. It's the language that is laughable. The good programmers in the PHP world try hard to avoid all the quirks, and do proper development and tooling with it. We have a saying where I work: "Choose the right tool for the job". You might be able to hammer a nail with a screwdriver or even embed a screw in the wall with a hammer, but it would be easier and more pleasent for everyone, if you used a hammer for the nail and a screwdriver for the screw.<|eor|><|sor|>> The good programmers in the PHP world try hard to avoid all the quirks, and do proper development and tooling with it. Yep, I've talked to them both and they've indeed put considerable effort on the PHP ecosystem. :P You know, I used to think that way, like, "it's about the language, not the programmers", but then you realise that it's a cyclic self-destructive relationship: a broken language, unless it has no viable alternatives for a given use case, will essentially filter the programmer pool for those who are clueless enough as to not realise (or care) the language is broken; this will subsequently make future contributions to the language and the ecosystem worse, thus diminishing its quality further. Fixing PHP would only require a moderately-sized compatibility break on things, most of which nobody uses anyway because they're broken beyond belief. The reason it hasn't (and won't) happen is because PHP has filtered its ecosystem to the point where only the clueless morons who see nothing wrong with it remain.<|eor|><|eoss|><|endoftext|>
6
lolphp
dchestnykh
1dc5kc
<|sols|><|sot|>"The algos Salsa10 and Salsa20 have been removed [from hash extension] because they are actually stream ciphers and not hash functions."<|eot|><|sol|>https://bugs.php.net/bug.php?id=60783<|eol|><|eols|><|endoftext|>
31
lolphp
Altreus
z4ozf
<|soss|><|sot|>PDO throws exceptions that cannot be recreated.<|eot|><|sost|>PDOException extends Exception. Fact. The code parameter to Exception's constructor is required to be an integer. It won't even try to coerce (even though this is supposed to be a coercive language) so you have to make sure it's an int. getCode() on an Exception therefore must return an int, right? Wrong. PDO creates an Exception using the error code returned from mysql, which is sometimes non-numeric. <?php try { $pdo = new PDO('mysql:host=localhost;dbname=testdb', 'testuser', 'password', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); $r = $pdo->query('select * from nonexistent'); } catch (PDOException $e) { throw new Exception($e->getMessage(), $e->getCode(), $e); } Make sure the DB exists, but the table doesn't. This is the quickest way I found of reproducing this. Output: Notice: A non well formed numeric value encountered in /home/alastair/pdo.php on line 9 If you're in dev mode, notices should be fatal, since the distinction in PHP between non-fatal and fatal errors is arbitrary at best anyway.<|eost|><|eoss|><|endoftext|>
28
lolphp
ealf
mga98
<|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0) <|eot|><|sost|><|eost|><|eoss|><|endoftext|>
30
lolphp
jsprogrammer
c3nlkcu
<|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0) <|eot|><|sost|><|eost|><|sor|>It's not that bad. They're just changing anything <0 to -1, >0 to 1 and leaving 0 alone. They're apparently more interested in comparing equality rather than the standard >0, <0, 0.<|eor|><|sor|>Whence the _BOOL in the name, then? :(<|eor|><|sor|>It refers to the lesser-known ternary boolean.<|eor|><|eoss|><|endoftext|>
15
lolphp
gwynjudd
c30oiug
<|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0) <|eot|><|sost|><|eost|><|sor|>This is the PHP equivalent of the famous daily wtf entry with true, false and file not found.<|eor|><|eoss|><|endoftext|>
10
lolphp
codefocus
c30pqat
<|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0) <|eot|><|sost|><|eost|><|sor|>Is this different than true/false/undefined in javascript or true/false/null in SQL, etc?<|eor|><|sor|>Yeah this is truePositive, trueNegative and false. ...don't ask me why :S<|eor|><|eoss|><|endoftext|>
9
lolphp
ealf
gb4sr
<|soss|><|sot|>The return value of uniqid() is the current time in milliseconds, as a hexadecimal string. How does PHP guarantee that the value is 'unique'?<|eot|><|sost|>Answer: usleep(1); Bonus awesome: * Takes optional parameter more_entropy "which should make the results more unique" by appending rand() * "Under Cygwin, the more_entropy must be set to TRUE for this function to work." * User comments recommending md5(uniqid()) for a "longer and more diverse unique id"<|eost|><|eoss|><|endoftext|>
29
lolphp
philikon
c1qaix0
<|soss|><|sot|>The return value of uniqid() is the current time in milliseconds, as a hexadecimal string. How does PHP guarantee that the value is 'unique'?<|eot|><|sost|>Answer: usleep(1); Bonus awesome: * Takes optional parameter more_entropy "which should make the results more unique" by appending rand() * "Under Cygwin, the more_entropy must be set to TRUE for this function to work." * User comments recommending md5(uniqid()) for a "longer and more diverse unique id"<|eost|><|sor|>Reminds me of [this awesome fix in PHP.](http://svn.php.net/viewvc/php/php-src/trunk/ext/standard/lcg.c?r1=293036&r2=293253)<|eor|><|eoss|><|endoftext|>
7
lolphp
brinchj
c1nsxmn
<|soss|><|sot|>The return value of uniqid() is the current time in milliseconds, as a hexadecimal string. How does PHP guarantee that the value is 'unique'?<|eot|><|sost|>Answer: usleep(1); Bonus awesome: * Takes optional parameter more_entropy "which should make the results more unique" by appending rand() * "Under Cygwin, the more_entropy must be set to TRUE for this function to work." * User comments recommending md5(uniqid()) for a "longer and more diverse unique id"<|eost|><|sor|>It's probably waaaay too slow to generate a real unique id. I mean, it's not like the OS's support such things.<|eor|><|eoss|><|endoftext|>
5
lolphp
tee2chains
mq28hy
<|sols|><|sot|>A Theory About PHP<|eot|><|sol|>https://www.commitstrip.com/en/2021/02/03/a-theory-about-php/<|eol|><|eols|><|endoftext|>
29
lolphp
coldoil
guefugs
<|sols|><|sot|>A Theory About PHP<|eot|><|sol|>https://www.commitstrip.com/en/2021/02/03/a-theory-about-php/<|eol|><|sor|>Eh, cute comic, but I'm going to disagree with the premise slightly. React at least has a coherent design philosophy, whether you agree with that philosophy or not. I think that's more than can be said for PHP.<|eor|><|eols|><|endoftext|>
21
lolphp
sproingie
j7zgqi
<|sols|><|sot|>Caching makes everything faster. Right?<|eot|><|sol|>https://thephp.cc/news/2020/10/caching-makes-everything-faster-right<|eol|><|eols|><|endoftext|>
28
lolphp
sproingie
g87u4c6
<|sols|><|sot|>Caching makes everything faster. Right?<|eot|><|sol|>https://thephp.cc/news/2020/10/caching-makes-everything-faster-right<|eol|><|soopr|>The place from which the lol arises. The LOLularity if you will: https://bugs.php.net/bug.php?id=78285 ... because a file doesn't exist if it does exist but isn't readable.<|eoopr|><|eols|><|endoftext|>
13
lolphp
Jinxuan
elvcls
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|eoss|><|endoftext|>
28
lolphp
AyrA_ch
fdktsh2
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|soopr|>I do not want to. I am not in PHP mail list and I think there must be someone saying that it is a feature, not bug.<|eoopr|><|sor|>> I think there must be someone saying that it is a feature, not bug. From the docs: > Note: The class name resolution using ::class is a compile time transformation. That means at the time the class name string is created no autoloading has happened yet. **As a consequence, class names are expanded even if the class does not exist. No error is issued in that case.** Apparently this is a feature, although a stupid one.<|eor|><|eoss|><|endoftext|>
33
lolphp
pilif
fdl69bi
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|soopr|>I do not want to. I am not in PHP mail list and I think there must be someone saying that it is a feature, not bug.<|eoopr|><|sor|>> I think there must be someone saying that it is a feature, not bug. From the docs: > Note: The class name resolution using ::class is a compile time transformation. That means at the time the class name string is created no autoloading has happened yet. **As a consequence, class names are expanded even if the class does not exist. No error is issued in that case.** Apparently this is a feature, although a stupid one.<|eor|><|sor|>Doing this at compile time seems useless to me... Under what circumstances would you want to know this? For what values of A is A::class not the same as 'A'?<|eor|><|sor|>> For what values of A is A::class not the same as 'A'? if A is defined inside of a namespace. Then A::class expands to the fully qualified name. > Under what circumstances would you want to know this? I don't. But IDEs can see the class reference and thus know that a class is actually used without needing to inspect every single string to maybe contain a class name.<|eor|><|eoss|><|endoftext|>
13
lolphp
SaltineAmerican_1970
fdkr78n
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|eoss|><|endoftext|>
12
lolphp
Jinxuan
fdkrlt1
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|soopr|>I do not want to. I am not in PHP mail list and I think there must be someone saying that it is a feature, not bug.<|eoopr|><|eoss|><|endoftext|>
9
lolphp
bart2019
fdmlnjy
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>I really dont understand what you're complaining about. I guess you mainly are misunderstanding the purpose of `::class`. It's aimed to statically resolve class aliases to a fully qualified class name. Not variables, not constants. Just bare identifiers. Whether the class actually exists is irrelevant, which makes perfect sense with autoloading, where PHP tries to load a class file when it tries to use it at runtime. Most people depend on Composer to map class names to file paths, though it is possible to completely do it yourself. * If you don't have a namespace statement or a use statement mapping to your identifiers, an alias maps to itself. That's backwards compatible. * If you have a namespace but no use statement, it returns the namespace concatenated to the class name with a backslash between them. * A use statement without "as" maps the fully qualified class name to the word after the last backslash, and ::class on that word returns that fully qualified class name. * A class name preceded by a leading backslash is a fully qualified name. * A use statement with "as" plus an identifier, maps that class to that identifier as the alias, and ::class does the reverse mapping * If you use a qualified class name, not preceded by a leading backslash and the first word is a mapped alias, then :: class will replace that first word by its fully qualified name, and append the rest of your qualified name to it. So, of course `use Typo\WTF; echo WTF::class;` doesn't fail: your use statement maps ghe fully qualified name `Typo::WTF`` to "WTF", and ::class simply inverts that mapping.<|eor|><|eoss|><|endoftext|>
8
lolphp
AyrA_ch
fdn15x3
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|soopr|>I do not want to. I am not in PHP mail list and I think there must be someone saying that it is a feature, not bug.<|eoopr|><|sor|>> I think there must be someone saying that it is a feature, not bug. From the docs: > Note: The class name resolution using ::class is a compile time transformation. That means at the time the class name string is created no autoloading has happened yet. **As a consequence, class names are expanded even if the class does not exist. No error is issued in that case.** Apparently this is a feature, although a stupid one.<|eor|><|sor|>> Apparently this is a feature, although a stupid one. Do you want to potentially autoload several thousand classes in something like an autoload map that uses ::class? Because checking if a class exists to use ::class, is how you end up potentially autoloading several thousand classes in something like an autoload map.<|eor|><|sor|>You technically don't have to load them. The compiler just has to check if there is a class with the given name at all. There's no need to compile the actual contents of the class. Autoloading doesn't happens automatically either but only after you write an autoloader. If your auto loader is slow as fuck it's kinda your problem and not that of PHP. If you really have 100'000+ classes you absolutely need to autoload, you can just add them to [the PHP compiler cache](https://www.php.net/manual/en/intro.opcache.php) instead of compiling them each time you use a ::class expression of your web server<|eor|><|eoss|><|endoftext|>
7
lolphp
Altreus
fdkwzoq
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|soopr|>I do not want to. I am not in PHP mail list and I think there must be someone saying that it is a feature, not bug.<|eoopr|><|sor|>> I think there must be someone saying that it is a feature, not bug. From the docs: > Note: The class name resolution using ::class is a compile time transformation. That means at the time the class name string is created no autoloading has happened yet. **As a consequence, class names are expanded even if the class does not exist. No error is issued in that case.** Apparently this is a feature, although a stupid one.<|eor|><|sor|>Doing this at compile time seems useless to me... Under what circumstances would you want to know this? For what values of A is A::class not the same as 'A'?<|eor|><|eoss|><|endoftext|>
6
lolphp
AyrA_ch
fdn4rob
<|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string. However, if A is not defined. We can still have `A::class`: ``` <?php new A; // PHP Fatal error: Class 'A' not found echo A::class; // It works, echoing A... ``` As mentioned in another post, if something is a string, it would not work, regardless of the class is defined or not: ``` <?php $a = 'A'; echo 'A'::class; // works as A::class echo $a::class; // PHP Fatal error: Cannot use ::class with dynamic class name define('WTF', 'A'); echo WTF::class; // echo WTF, ::class is not compatible with constant ``` Things can become crazier when you have typo, even in use statement; ``` <?php use Typo\WTF; echo WTF::class; // It works as echoing Typo\WTF; It shall fail... ```<|eost|><|sor|>Did you file a bug report?<|eor|><|soopr|>I do not want to. I am not in PHP mail list and I think there must be someone saying that it is a feature, not bug.<|eoopr|><|sor|>> I think there must be someone saying that it is a feature, not bug. From the docs: > Note: The class name resolution using ::class is a compile time transformation. That means at the time the class name string is created no autoloading has happened yet. **As a consequence, class names are expanded even if the class does not exist. No error is issued in that case.** Apparently this is a feature, although a stupid one.<|eor|><|sor|>> Apparently this is a feature, although a stupid one. Do you want to potentially autoload several thousand classes in something like an autoload map that uses ::class? Because checking if a class exists to use ::class, is how you end up potentially autoloading several thousand classes in something like an autoload map.<|eor|><|sor|>You technically don't have to load them. The compiler just has to check if there is a class with the given name at all. There's no need to compile the actual contents of the class. Autoloading doesn't happens automatically either but only after you write an autoloader. If your auto loader is slow as fuck it's kinda your problem and not that of PHP. If you really have 100'000+ classes you absolutely need to autoload, you can just add them to [the PHP compiler cache](https://www.php.net/manual/en/intro.opcache.php) instead of compiling them each time you use a ::class expression of your web server<|eor|><|sor|>Compiling and executing the contents of a file is how PHP determines if a class exists in the first place. https://www.reddit.com/r/PHP/comments/elas9e/i_know_that_php_script_are_stored_in_memory/fdgl1co/<|eor|><|sor|>> Compiling and executing the contents of a file is how PHP determines if a class exists in the first place. The comment you linked literally also explains the solution to this problem.<|eor|><|eoss|><|endoftext|>
5
lolphp
ntzm_
e97pvd
<|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|eols|><|endoftext|>
27
lolphp
duskwuff
fahfebw
<|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`. Protected attributes use internal key names like `\0*\0foo`.<|eor|><|eols|><|endoftext|>
21
lolphp
Altreus
faioijq
<|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`. Protected attributes use internal key names like `\0*\0foo`.<|eor|><|sor|>So var_dump, as far as I can tell explicitly designed for debugging, doesn't even output non-printable characters in a visible way?<|eor|><|eols|><|endoftext|>
14
lolphp
colshrapnel
fah0qy7
<|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>This one is amazing. Especially the key() output.<|eor|><|eols|><|endoftext|>
10
lolphp
duskwuff
faiq18r
<|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`. Protected attributes use internal key names like `\0*\0foo`.<|eor|><|sor|>So var_dump, as far as I can tell explicitly designed for debugging, doesn't even output non-printable characters in a visible way?<|eor|><|sor|>Unfortunately, it doesn't. `var_export` does a better job here.<|eor|><|eols|><|endoftext|>
7
lolphp
shaql
fajlmt5
<|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`. Protected attributes use internal key names like `\0*\0foo`.<|eor|><|sor|>That'd explain why var_dump said the "Foobar" string had a length of 8...<|eor|><|eols|><|endoftext|>
5
lolphp
sproingie
cmt0yc
<|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|eols|><|endoftext|>
28
lolphp
the_alias_of_andrea
ew4iqp7
<|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|sor|>Because they're not nested functions like in Python, they are just global function definitions that are executed as statements. It does have its uses (polyfills!), but indeed, you must make sure you don't execute it twice. Use a closure if you want nesting, that way you also get variable imports.<|eor|><|eols|><|endoftext|>
15
lolphp
bart2019
ew4vthw
<|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|sor|>Because they're not nested functions like in Python, they are just global function definitions that are executed as statements. It does have its uses (polyfills!), but indeed, you must make sure you don't execute it twice. Use a closure if you want nesting, that way you also get variable imports.<|eor|><|sor|>You can even put a function definition in the body of an "if" block, and have it conditionally be defined. But only once, or it'll crash.<|eor|><|eols|><|endoftext|>
11
lolphp
jesseschalken
ew4hz1w
<|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|sor|>They should really disallow function, class and constant definitions in function and method bodies IMO. It looks way too much like a local definition. <|eor|><|eols|><|endoftext|>
10
lolphp
HannesHendrik
ch5c9r
<|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|eols|><|endoftext|>
26
lolphp
thenickdude
eupyy0s
<|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|sor|>The instruction to call `unset()` sounds a little odd. To clear an array you're going to pass to a function you'd normally think to use `$arr = []` (or even `$arr = array()`), right? That's because this line of documentation dates all the way back to PHP/FI (i.e. PHP 2), where `unset()` was the only way available to clear an array. There were no array literals, so you couldn't easily assign an empty array to it, and you couldn't set it to `null` because in PHP/FI assigning to a variable that contained an array only overwrote the element at index #0! Here's that part of the [exec() documentation](https://www.php.net/manual/phpfi2.php#eval) from PHP/FI: >Make sure you UnSet the array before the call if your array already contains elements and you want to start filling it at array element 0. In PHP/FI, it behaved as if "register_globals" was on all the time, so any variable that you didn't explicitly overwrite could be set directly from the user's request (GET/POST parameters). So if you weren't aware that exec() *appended* to the passed array, and you didn't bother to unset() it before the call, the end result was that the user could add an array in their request which would be prepended to the output of your exec() call, which causes all sorts of havoc. I earned $6500 in bounties from this one lolphp. I think if exec() was redesigned today they would have made it overwrite, rather than append, to the passed array!<|eor|><|eols|><|endoftext|>
47
lolphp
dahakaDAHK
eupnonf
<|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|sor|>I'm not sure this qualifies as lolphp. There is no question if the array is modified - the choice is append or overwrite. Emptying the array and then appending to it is the same as overwriting, and doing it like this saves them from having a fourth parameter to choose between append and overwrite.<|eor|><|eols|><|endoftext|>
8
lolphp
vita10gy
eur3xab
<|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|sor|>I'm not sure this qualifies as lolphp. There is no question if the array is modified - the choice is append or overwrite. Emptying the array and then appending to it is the same as overwriting, and doing it like this saves them from having a fourth parameter to choose between append and overwrite.<|eor|><|sor|>\> I'm not sure this qualifies as lolphp. Welcome to /r/lolphp<|eor|><|eols|><|endoftext|>
6
lolphp
n0t0ri0us9
55sogy
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|eols|><|endoftext|>
29
lolphp
galaktos
d8dcq0h
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle) (as well as common sense). As you do.<|eor|><|eols|><|endoftext|>
19
lolphp
galaktos
d8ddong
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle) (as well as common sense). As you do.<|eor|><|sor|>"in blatant disregard of common sense" is a design principle of PHP against which all features are validated<|eor|><|sor|>in blatant disregard of common sense is also a great autobiography title or subtitle.<|eor|><|eols|><|endoftext|>
15
lolphp
galaktos
d8dn9eb
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle) (as well as common sense). As you do.<|eor|><|sor|>It's not in disregard of LSP. You can return a subclass from a method in a subclass. The type declaration simply cannot be as precise as would be ideal.<|eor|><|sor|>No, thats fine. But the top comment was saying that returning a *superclass* from a method in a subclass should also be allowed, which is rubbish.<|eor|><|eols|><|endoftext|>
12
lolphp
jesseschalken
d8egi3o
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>I'm not sure what's particularly wrong with invariant type declarations. They're inconvenient, perhaps, but PHP is not restricting you from returning a subclass. PHP 7 lacks contravariant return type inheritance checks because getting it to work consistently is difficult and every approach involves tradeoffs, and we wanted it to work cleanly in all cases or not at all. PHP has enough inconsistency as it is. Nikita explains it here: https://reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/d8dce9u It's sort of an inherently thorny problem. Whichever approach PHP 7 could have taken, I expect /r/lolphp would be complaining about the tradeoffs.<|eor|><|sor|>> They're inconvenient, perhaps, but PHP is not restricting you from returning a subclass. In terms of static analysis, PHP *is* restricting you from returning a subclass and allowing callers to *know* (via the method signature) that you're returning that subclass. For example, this reports a static analysis error in PhpStorm because `Bar::baz()` couldn't specify to the caller that it was going to return a `Bar`. class Foo { public function baz(): Foo { return $this; } } class Bar extends Foo { public function baz(): Foo { return $this; } public function barMethod(): string { return 'bar'; } } function main() { $bar = new Bar(); $bar->baz()->barMethod(); // barMethod() not found on Foo } But annotating `Bar::baz()` as returning `Bar` works perfectly fine in Hack. It seems only to be PHP's weird approach of checking method compatibility at run time when classes are loaded (rather than via a dedicated type checker) that gets in the way.<|eor|><|eols|><|endoftext|>
7
lolphp
the_alias_of_andrea
d8dmsf3
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>I'm not sure what's particularly wrong with invariant type declarations. They're inconvenient, perhaps, but PHP is not restricting you from returning a subclass. PHP 7 lacks contravariant return type inheritance checks because getting it to work consistently is difficult and every approach involves tradeoffs, and we wanted it to work cleanly in all cases or not at all. PHP has enough inconsistency as it is. Nikita explains it here: https://reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/d8dce9u It's sort of an inherently thorny problem. Whichever approach PHP 7 could have taken, I expect /r/lolphp would be complaining about the tradeoffs.<|eor|><|eols|><|endoftext|>
6
lolphp
the_alias_of_andrea
d8dndy9
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle) (as well as common sense). As you do.<|eor|><|sor|>It's not in disregard of LSP. You can return a subclass from a method in a subclass. The type declaration simply cannot be as precise as would be ideal.<|eor|><|sor|>No, thats fine. But the top comment was saying that returning a *superclass* from a method in a subclass should also be allowed, which is rubbish.<|eor|><|sor|>Oh, right, I misread contravariant as covariant there. Yes, that would be absurd.<|eor|><|eols|><|endoftext|>
6
lolphp
the_alias_of_andrea
d8dmnqj
<|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle) (as well as common sense). As you do.<|eor|><|sor|>It's not in disregard of LSP. You can return a subclass from a method in a subclass. The type declaration simply cannot be as precise as would be ideal.<|eor|><|eols|><|endoftext|>
5
lolphp
pgl
2vrgr6
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|eols|><|endoftext|>
27
lolphp
ladaghini
cok9wi8
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>Isn't criteria already plural?<|eor|><|eols|><|endoftext|>
21
lolphp
pgl
cokadhk
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|soopr|> CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException My eyes!<|eoopr|><|eols|><|endoftext|>
18
lolphp
allthediamonds
cokx0c8
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>The best thing about PHP programmers is their wild fantasies of what good code looks like.<|eor|><|eols|><|endoftext|>
16
lolphp
pilif
col1vs3
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>The Javaization of PHP is complete. PHP finally got its equivalent to the [AbstractSingletonProxyFactoryBean](http://docs.spring.io/spring-framework/docs/2.5.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html)<|eor|><|eols|><|endoftext|>
15
lolphp
DoctorWaluigiTime
cokt9zb
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>While this is hilarious coding, is this really /r/lolphp material? This looks like a bad programmer to me.<|eor|><|eols|><|endoftext|>
12
lolphp
implicit_cast
cokf3xr
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>The signal to noise ratio on this project is ridiculously low. It looks to be broken up into nearly 600 projects, most of which consist entirely of boilerplate and interface fluff. Witness https://github.com/irestful/Booleans<|eor|><|eols|><|endoftext|>
11
lolphp
MeLoN_DO
coka5k6
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>Looks like generated code.<|eor|><|sor|>No its not, I met the guy that wrote this.<|eor|><|eols|><|endoftext|>
11
lolphp
pgl
cokacyz
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>Isn't criteria already plural?<|eor|><|soopr|>That's exactly what I thought.<|eoopr|><|eols|><|endoftext|>
9
lolphp
pgl
conzrnf
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>The signal to noise ratio on this project is ridiculously low. It looks to be broken up into nearly 600 projects, most of which consist entirely of boilerplate and interface fluff. Witness https://github.com/irestful/Booleans<|eor|><|sor|>Haha it's been removed! <|eor|><|soopr|>> removed It's been *improved*: https://github.com/irestful/Core/blob/master/Core/Domain/Primitives/Booleans/Builders/Factories/BooleanBuilderFactory.php<|eoopr|><|eols|><|endoftext|>
8
lolphp
poizan42
colea1g
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>Wait, this actually beats the venerable InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState <|eor|><|eols|><|endoftext|>
6
lolphp
FionaSarah
conzk8t
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>While this is hilarious coding, is this really /r/lolphp material? This looks like a bad programmer to me.<|eor|><|sor|>It's systematic of this weird cargo-culting of Java-style code that PHP has been chasing since PHP 5. Completely ignoring the reasons why Java has the features it does or the code is written like it is, they write their PHP code the same way because "it's the professional enterprise way, right?" <|eor|><|eols|><|endoftext|>
6
lolphp
Various_Pickles
cok8ynp
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>Looks like generated code.<|eor|><|eols|><|endoftext|>
5
lolphp
pgl
cokm8aq
<|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueueMessageRetrieverCriteriaToMultipleQueueMessageRetrieverCriteriaException.php<|eol|><|sor|>The signal to noise ratio on this project is ridiculously low. It looks to be broken up into nearly 600 projects, most of which consist entirely of boilerplate and interface fluff. Witness https://github.com/irestful/Booleans<|eor|><|soopr|>https://github.com/irestful/Booleans/blob/master/Booleans/Domain/Booleans/Boolean.php Ye gods.<|eoopr|><|eols|><|endoftext|>
5