subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
lolphp | ThisIsADogHello | 1eebqi | <|sols|><|sot|>zPanel support team calls forum user "fucken little know it all" as he points out vulnerabilities. (xpost from /r/netsec)<|eot|><|sol|>http://forums.zpanelcp.com/showthread.php?27597-Are-there-ZPanel-vulnerabilities-as-some-people-claims&p=106627<|eol|><|eols|><|endoftext|> | 34 |
lolphp | BufferUnderpants | c9zjp5v | <|sols|><|sot|>zPanel support team calls forum user "fucken little know it all" as he points out vulnerabilities. (xpost from /r/netsec)<|eot|><|sol|>http://forums.zpanelcp.com/showthread.php?27597-Are-there-ZPanel-vulnerabilities-as-some-people-claims&p=106627<|eol|><|sor|>Why is this significant to /r/lolphp? Sure, it's about PHP developers being unprofessional, sloppy, and generally douchebags, but you see the same in lots of opensource projects, it doesn't seem to be *because* of PHP, save as a consequence of the general aura of shittiness of the language.<|eor|><|eols|><|endoftext|> | 21 |
lolphp | ANAL_GRAVY | c9zgasw | <|sols|><|sot|>zPanel support team calls forum user "fucken little know it all" as he points out vulnerabilities. (xpost from /r/netsec)<|eot|><|sol|>http://forums.zpanelcp.com/showthread.php?27597-Are-there-ZPanel-vulnerabilities-as-some-people-claims&p=106627<|eol|><|sor|>Site down! Very interesting... Don't suppose you kept screenshots?
Edit: Ah, found some in the /r/netsec thread: http://www.reddit.com/r/netsec/comments/1ee0eg/zpanel_support_team_calls_forum_user_fucken/<|eor|><|eols|><|endoftext|> | 9 |
lolphp | danielsamuels | 19cwgc | <|sols|><|sot|>Turns out the documentation on foreach doesn't match the actual behaviour.<|eot|><|sol|>http://stackoverflow.com/questions/10057671/how-foreach-actually-works/<|eol|><|eols|><|endoftext|> | 34 |
lolphp | Rhomboid | c8mwg9c | <|sols|><|sot|>Turns out the documentation on foreach doesn't match the actual behaviour.<|eot|><|sol|>http://stackoverflow.com/questions/10057671/how-foreach-actually-works/<|eol|><|sor|>PHP internals remind me of [There I Fixed It](http://failblog.cheezburger.com/tag/there-i-fixed-it).<|eor|><|eols|><|endoftext|> | 16 |
lolphp | MrDOS | c8n18d9 | <|sols|><|sot|>Turns out the documentation on foreach doesn't match the actual behaviour.<|eot|><|sol|>http://stackoverflow.com/questions/10057671/how-foreach-actually-works/<|eol|><|sor|>Good God [the explanation](http://stackoverflow.com/a/14854568). Who would learn all the intricacies of PHP and still use it?<|eor|><|sor|>Conversely, who would bother to learn the intricacies of a technology with no use for it?<|eor|><|eols|><|endoftext|> | 9 |
lolphp | sickofthisshit | c8my2ol | <|sols|><|sot|>Turns out the documentation on foreach doesn't match the actual behaviour.<|eot|><|sol|>http://stackoverflow.com/questions/10057671/how-foreach-actually-works/<|eol|><|sor|>Good God [the explanation](http://stackoverflow.com/a/14854568). Who would learn all the intricacies of PHP and still use it?<|eor|><|eols|><|endoftext|> | 6 |
lolphp | sickofthisshit | c8niror | <|sols|><|sot|>Turns out the documentation on foreach doesn't match the actual behaviour.<|eot|><|sol|>http://stackoverflow.com/questions/10057671/how-foreach-actually-works/<|eol|><|sor|>Good God [the explanation](http://stackoverflow.com/a/14854568). Who would learn all the intricacies of PHP and still use it?<|eor|><|sor|>It's a pretty detailed explanation, but the person writing is what's describing what's going on under the hood.
The question you want to ask is, who would want to develop PHP itself? It seems like an exercise in self torture
EDIT: spelling<|eor|><|sor|>Well, I don't know much about PHP. But he starts with two ways to iterate: internal array pointer and a HashPosition.
OK. A bit weird, but you know, all languages have warts.
But he's not done.
> "current is also a by-ref function... (current is actually a prefer-ref"
Uh, what? There are three (or more?) ways to handle function arguments in this monstrosity?
> When an object is iterated there are two cases:
Sigh. OO is hard, isn't it?
> "One last detail of the foreach behavior that I did not yet mention (because it can be used to get really weird behavior) is what happens when you try to change the internal array pointer during iteration."
AUUGH! I just wanted an implementation of foreach...how hard can you make this for yourself?<|eor|><|eols|><|endoftext|> | 5 |
lolphp | jdiez17 | 16vbra | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|eols|><|endoftext|> | 36 |
lolphp | phoshi | c8078h6 | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|sor|>Unless you define a constant called "*push*" that somehow using the () operator on is valid, I don't see the problem.
Other languages routinely and consistently correctly parse things far more "*ambiguous*" than this.<|eor|><|sor|>How about a top level function called "push" that returns a string? How can the parser possibly know, without executing the function, that it's going to return a string that should be concatenated to that array?
Ambiguous operators in a weakly, loosely typed language is just begging for trouble. Ambiguous operators in a weakly, loosely typed language that doesn't even create an AST during parsing? You're completely fucked. <|eor|><|soopr|>What? PHP doesn't create an AST during parsing? Are you kidding me, or...??!??<|eoopr|><|sor|>I wish I was kidding you. I am unfortunately not. The parser goes through the code in one pass emitting opcodes directly. One of the most popular languages on the Web, everybody. <|eor|><|eols|><|endoftext|> | 14 |
lolphp | dipswitch | c7zp1e6 | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|eols|><|endoftext|> | 12 |
lolphp | dropdownmenu | c7zu33i | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>2013 is the year of PHP? These guys have not been paying attention to anything like Ruby or Node.js...
The best part of the article is the large quote:
"Roughly eighty percent of the arguments against PHP are rooted in ignorance."
wat<|eor|><|eols|><|endoftext|> | 12 |
lolphp | jdiez17 | c7zy8hl | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>I don't get it. Functional language, as in actually works and is useful, or functional language as in follows the functional paradigm?<|eor|><|soopr|>I'm betting my money on "actually works and is useful", but the author bumped into a word that has a very specific meaning. It's like sports commentators saying "there's a differential in the score..."
IRKS ME.<|eoopr|><|eols|><|endoftext|> | 12 |
lolphp | infinull | c7zwg55 | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|sor|>Unless you define a constant called "*push*" that somehow using the () operator on is valid, I don't see the problem.
Other languages routinely and consistently correctly parse things far more "*ambiguous*" than this.<|eor|><|sor|>Yeah, but most languages perform a lex, parse, treewalk (compile) cycle. PHP doesn't differentiate between those 3 steps and performs them all at once.
Put another way, the parser directly emits bytecode.<|eor|><|eols|><|endoftext|> | 12 |
lolphp | tdammers | c8003zq | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>"." vs. "->" is not PHP's most pressing problem. Hell no.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | adambrenecki | c806w8w | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>This sounds like yet another of those "PHP is better than all of the other languages because it's just recently got things the others have had for ages" articles.
> Inspired by tools, like Bundler and NPM, the PHP community can now stop reinventing the wheel over and over again, thanks to Composer.
So, Ruby and Node's existing package management inspired this. Python also has `pip`/`virtualenv` and the PyPI.
> Laravel comes with Eloquent, an ORM that completely rethinks everything to do with databases. ... youre given objects, which you can modify and save. ... all of this can be done with an OOP style, using simple and readable methods, such as find and delete.
So, basically the same thing as Django's ORM, and if memory serves me right Ruby's as well. And probably many others.
> templating, routing, migrations
Just like every other web framework.
> Traits
Basically like an interface in Java, or stuff you can do if your language supports multiple inheritance.
> Generators
Looks like Python's generators.
> CLI Web server
Most Python, Ruby, Node etc web frameworks have this.
> The New Password Hashing API
I'm not even going to say anything negative about this, because it's much needed.
> Test Driven Development
Has nothing to do with the actual language.
Don't get me wrong, all of these things are good things, and it's good that PHP is catching up. But I think "the Year of PHP" is a bit much.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | escozzia | c8051ga | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>The authors of the article act as though the big complaint about PHP is that it is unfamiliar, or that it somehow lacks features we want... All the crazy inconsistencies of PHP left aside, its big problem is not that it lacks important features, but that it discourages use of them. "Traits!" they tell us, "the new PHP has trait inheritance!" but nobody will use it, because at a fundamental level the language encourages you to be stupid.
Sure, you can write your PHP app in a very strong OOP style, but because of the way the language itself is structured, you most likely will not. Instead you'll make a horrible mess where the logic of your app is littered all over the place and your code base has neither head nor tail.
This kind of stuff doesn't happen in languages like Ruby, Python or Java, not because the programmers are better, but because those languages actively punish you for being idiotic.<|eor|><|eols|><|endoftext|> | 9 |
lolphp | fragglet | c7zu7po | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>"Functional" is the wrong word, but I kind of see what he means. "Imperative" might be a better choice.<|eor|><|eols|><|endoftext|> | 9 |
lolphp | phoshi | c7zwrm5 | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|sor|>Unless you define a constant called "*push*" that somehow using the () operator on is valid, I don't see the problem.
Other languages routinely and consistently correctly parse things far more "*ambiguous*" than this.<|eor|><|sor|>How about a top level function called "push" that returns a string? How can the parser possibly know, without executing the function, that it's going to return a string that should be concatenated to that array?
Ambiguous operators in a weakly, loosely typed language is just begging for trouble. Ambiguous operators in a weakly, loosely typed language that doesn't even create an AST during parsing? You're completely fucked. <|eor|><|eols|><|endoftext|> | 9 |
lolphp | jdiez17 | c7zy95h | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|sor|>Unless you define a constant called "*push*" that somehow using the () operator on is valid, I don't see the problem.
Other languages routinely and consistently correctly parse things far more "*ambiguous*" than this.<|eor|><|sor|>How about a top level function called "push" that returns a string? How can the parser possibly know, without executing the function, that it's going to return a string that should be concatenated to that array?
Ambiguous operators in a weakly, loosely typed language is just begging for trouble. Ambiguous operators in a weakly, loosely typed language that doesn't even create an AST during parsing? You're completely fucked. <|eor|><|soopr|>What? PHP doesn't create an AST during parsing? Are you kidding me, or...??!??<|eoopr|><|eols|><|endoftext|> | 9 |
lolphp | jdiez17 | c7zpcj9 | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|soopr|>Considering [the](http://phpsadness.com/sad/2) [robustness](http://phpsadness.com/sad/31) [of](http://phpsadness.com/sad/37) [PHP's parser](http://phpsadness.com/sad/46), I'm sure that won't be a pro---ohwait.<|eoopr|><|eols|><|endoftext|> | 8 |
lolphp | more_exercise | c7zxalo | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>Why does PHP have a huge crush on Java these days? I'd rather remove some Perl [features](http://codepad.org/hSgaTEj1) instead...<|eor|><|sor|>It's not the perl features that's the problem. It's the implementation of those features.
`(13 == "13LarryWallTest" ? 'Perl' : 'Not Perl')` yielding `'Perl'` is the correct perl answer for this bit of code. If you had wanted to compare the values as strings, all you had to do was replace `==` (the numeric equality) with `eq` (the string equality).
`(13 eq "13LarryWallTest" ? 'Perl' : 'Not Perl')` gives you `'Not Perl'`
Sure. There are problems if you use equality wrong (`'foo' == 'bar'` because these are both 0 numerically). But that's your own damn fault for trying to compare strings numerically.
PHP doesn't have the `eq` operator, and therein lies the problem.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | more_exercise | c7zx7mo | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>"Functional" is the wrong word, but I kind of see what he means. "Imperative" might be a better choice.<|eor|><|sor|>They either meant "procedural" ("functions" in C are not functions but procedures) or "functioning" (in contrast to PHP).<|eor|><|sor|>I prefer the second meaning, myself.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | X8qV | c81sya0 | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|soopr|>Considering [the](http://phpsadness.com/sad/2) [robustness](http://phpsadness.com/sad/31) [of](http://phpsadness.com/sad/37) [PHP's parser](http://phpsadness.com/sad/46), I'm sure that won't be a pro---ohwait.<|eoopr|><|sor|>That's not really a good complaint given that every single C-like language I know of has this "*problem*" as well.<|eor|><|sor|>GCC disagrees:
error: invalid digit "8" in octal constant<|eor|><|eols|><|endoftext|> | 6 |
lolphp | Dereleased | c8ngqch | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>>you would write something, like
> $arr.push("Value");
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.<|eor|><|sor|>Unless you define a constant called "*push*" that somehow using the () operator on is valid, I don't see the problem.
Other languages routinely and consistently correctly parse things far more "*ambiguous*" than this.<|eor|><|sor|>Yeah, but most languages perform a lex, parse, treewalk (compile) cycle. PHP doesn't differentiate between those 3 steps and performs them all at once.
Put another way, the parser directly emits bytecode.<|eor|><|sor|>Not to mention the "parser", which should emit only parse errors, occasionally emits fatal errors instead, apparently just for fun. There are, in fact, constructs that are allowed by the grammar specifically and only to emit a fatal error.
Example:
inner_statement:
statement
| function_declaration_statement
| class_declaration_statement
| T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); }
;
so if you do something silly like
if ($foo) __halt_compiler();
All you get is a fatal about how you can't use it from any scope but the outermost, which raises the question, why even allow it in the grammar? Just let it be a parse error and be done with it.
Another:
isset_variable:
variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); }
| expr_without_variable { zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); }
;
There's also one that emits an E_DEPRECATED when you assign a new object instance by reference, e.g.
$foo = & new FooBar();
On the fence about that one, obviously it shouldn't just become a parse error right away, breaking code and all that, but at the same time, call-time pass-by-reference for functions is long deprecated and it doesn't emit the E_DEPRECATED in the parser itself, so why do this one here? Just inconsistent.
EDIT: Just noticed the advanced age of this thread. Necromancy!<|eor|><|eols|><|endoftext|> | 6 |
lolphp | jdiez17 | c7zvoww | <|sols|><|sot|>(...) transforming into a functional language, like C (...) <|eot|><|sol|>http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/<|eol|><|sor|>"Functional" is the wrong word, but I kind of see what he means. "Imperative" might be a better choice.<|eor|><|soopr|>Yes, "imperative" is the proper term. It may not have been fair of me to cherry-pick that particular statement, but it was the point where I started to really crack up.<|eoopr|><|eols|><|endoftext|> | 5 |
lolphp | barubary | d9lhpz | <|soss|><|sot|>The consistent behavior of unary plus<|eot|><|sost|>What does the unary `+` operator do? Informally, it converts its operand to a number.
What does that actually mean in practice?
echo +1, "\n";
# 1
echo +0.5, "\n";
# 0.5
For integers and floats, it's a no-op.
echo +"A", "\n";
# Warning: A non-numeric value encountered in Command line code on line 1
# 0
OK, so an invalid argument triggers a warning and just returns `0`. How about objects?
echo +new stdClass, "\n";
# Notice: Object of class stdClass could not be converted to int in Command line code on line 1
# 1
Three interesting differences to the previous result:
1. You get a notice, not a warning. Clearly code like this is not a big mistake: Trying to use random objects as numbers could happen to anyone and doesn't deserve closer attention.
2. The message says *converted to int*, even though `+` doesn't coerce its operand to `int`.
3. The result is `1`.
How about arrays?
echo +[], "\n";
# Fatal error: Unsupported operand types in Command line code on line 1
Are you crazy?! You cannot convert an array to a number! That's a hard error, obviously.<|eost|><|eoss|><|endoftext|> | 35 |
lolphp | minimim | f1jlvaq | <|soss|><|sot|>The consistent behavior of unary plus<|eot|><|sost|>What does the unary `+` operator do? Informally, it converts its operand to a number.
What does that actually mean in practice?
echo +1, "\n";
# 1
echo +0.5, "\n";
# 0.5
For integers and floats, it's a no-op.
echo +"A", "\n";
# Warning: A non-numeric value encountered in Command line code on line 1
# 0
OK, so an invalid argument triggers a warning and just returns `0`. How about objects?
echo +new stdClass, "\n";
# Notice: Object of class stdClass could not be converted to int in Command line code on line 1
# 1
Three interesting differences to the previous result:
1. You get a notice, not a warning. Clearly code like this is not a big mistake: Trying to use random objects as numbers could happen to anyone and doesn't deserve closer attention.
2. The message says *converted to int*, even though `+` doesn't coerce its operand to `int`.
3. The result is `1`.
How about arrays?
echo +[], "\n";
# Fatal error: Unsupported operand types in Command line code on line 1
Are you crazy?! You cannot convert an array to a number! That's a hard error, obviously.<|eost|><|sor|>Let's try it with a sane language, shall we?
> say +1
1
> say +
0.5
> say +'A'
Cannot convert string to number: base-10 number must begin with valid digits or '.' in 'A' (indicated by ) [...]
> say +'1'
1
> say +Any.new
Cannot resolve caller Numeric(Any:D: ); none of these signatures match:
(Mu:U \v: *%_)
> say +()
0
The Str class has a .numeric method (inherited from Cool), but it returns a Failure when it cannot recognize a number, which blows up into an exception when you try to use it. The Any class doesn't have a .numeric method, so there's an exception when one tries to call unary + on it. Calling .numeric on Numeric is a no-op, returns the object itself.<|eor|><|eoss|><|endoftext|> | 7 |
lolphp | smegnose | f1m9z93 | <|soss|><|sot|>The consistent behavior of unary plus<|eot|><|sost|>What does the unary `+` operator do? Informally, it converts its operand to a number.
What does that actually mean in practice?
echo +1, "\n";
# 1
echo +0.5, "\n";
# 0.5
For integers and floats, it's a no-op.
echo +"A", "\n";
# Warning: A non-numeric value encountered in Command line code on line 1
# 0
OK, so an invalid argument triggers a warning and just returns `0`. How about objects?
echo +new stdClass, "\n";
# Notice: Object of class stdClass could not be converted to int in Command line code on line 1
# 1
Three interesting differences to the previous result:
1. You get a notice, not a warning. Clearly code like this is not a big mistake: Trying to use random objects as numbers could happen to anyone and doesn't deserve closer attention.
2. The message says *converted to int*, even though `+` doesn't coerce its operand to `int`.
3. The result is `1`.
How about arrays?
echo +[], "\n";
# Fatal error: Unsupported operand types in Command line code on line 1
Are you crazy?! You cannot convert an array to a number! That's a hard error, obviously.<|eost|><|sor|>No doubt about it, not much consistency. The last error highlights the parser quirks: the error is from `+` being the union operator for arrays, but there is no other operand at all, so saying there's one of the wrong type is a bit odd.<|eor|><|eoss|><|endoftext|> | 6 |
lolphp | DolphinsAreOk | cy76qr | <|sols|><|sot|>Filter input by default doesnt filter input.<|eot|><|sol|>https://www.php.net/filter_input<|eol|><|eols|><|endoftext|> | 32 |
lolphp | maweki | eyqg5rs | <|sols|><|sot|>Filter input by default doesnt filter input.<|eot|><|sol|>https://www.php.net/filter_input<|eol|><|sor|>"filter_input Gets a specific external variable by name and optionally filters it"
I don't even know. What's that supposed to mean? What does it do? That's barely more information than the function name itself.<|eor|><|eols|><|endoftext|> | 22 |
lolphp | dahakaDAHK | eysj4uh | <|sols|><|sot|>Filter input by default doesnt filter input.<|eot|><|sol|>https://www.php.net/filter_input<|eol|><|sor|>I love the return value section, it has everything: returns false for one error case, null for another and has the option to switch the two.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | DolphinsAreOk | eyqqnln | <|sols|><|sot|>Filter input by default doesnt filter input.<|eot|><|sol|>https://www.php.net/filter_input<|eol|><|sor|>"filter_input Gets a specific external variable by name and optionally filters it"
I don't even know. What's that supposed to mean? What does it do? That's barely more information than the function name itself.<|eor|><|soopr|>Well its a specific external variable, not just one at random.<|eoopr|><|eols|><|endoftext|> | 10 |
lolphp | maweki | eyretn6 | <|sols|><|sot|>Filter input by default doesnt filter input.<|eot|><|sol|>https://www.php.net/filter_input<|eol|><|sor|>"filter_input Gets a specific external variable by name and optionally filters it"
I don't even know. What's that supposed to mean? What does it do? That's barely more information than the function name itself.<|eor|><|soopr|>Well its a specific external variable, not just one at random.<|eoopr|><|sor|>And supposedely it's the whole variable. I mean, straight out the whole thing. Not just a piece of it.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | ranisalt | eyrs0qb | <|sols|><|sot|>Filter input by default doesnt filter input.<|eot|><|sol|>https://www.php.net/filter_input<|eol|><|sor|>"filter_input Gets a specific external variable by name and optionally filters it"
I don't even know. What's that supposed to mean? What does it do? That's barely more information than the function name itself.<|eor|><|soopr|>Well its a specific external variable, not just one at random.<|eoopr|><|sor|>And supposedely it's the whole variable. I mean, straight out the whole thing. Not just a piece of it.<|eor|><|sor|>I think you also have the option of filtering it, but the meaning of "filter" is left to the reader as an exercise.<|eor|><|eols|><|endoftext|> | 7 |
lolphp | D1551D3N7 | 9864xv | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|eols|><|endoftext|> | 33 |
lolphp | AyrA_ch | e4dl4op | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>> PHP unserialization or object injection vulnerabilities were initially documented in 2009, which could allow an attacker to perform different kinds of attacks by supplying malicious inputs to the unserialize() PHP function.
It's not like there is [a big warning in the docs](https://secure.php.net/manual/en/function.unserialize.php) to not allow it to unserialize untrusted data.<|eor|><|eols|><|endoftext|> | 16 |
lolphp | D1551D3N7 | e4dldtc | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>> PHP unserialization or object injection vulnerabilities were initially documented in 2009, which could allow an attacker to perform different kinds of attacks by supplying malicious inputs to the unserialize() PHP function.
It's not like there is [a big warning in the docs](https://secure.php.net/manual/en/function.unserialize.php) to not allow it to unserialize untrusted data.<|eor|><|soopr|>Yes but you don't have to be using phar (or serialization) for this to cause you problems. An attacker can abuse phar:// as a file handler if you have any functionality with file functions that a user can submit the full file path, like file_get_contents for instance.<|eoopr|><|eols|><|endoftext|> | 14 |
lolphp | arnolddaniels | e4r10s0 | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>It's not true that this handler can only be disabled by recompiling PHP. You can disable stream handlers at runtime. Fixing this vulnerability is trivial.
php > var_export(stream_get_wrappers());
array (
.....
9 => 'ftp',
10 => 'phar',
11 => 'zip',
)
php > stream_wrapper_unregister('phar');
php > var_export(stream_get_wrappers());
array (
.....
9 => 'ftp',
10 => 'zip',
)
php > include('phar://some.phar');
PHP Warning: include(): Unable to find the wrapper "phar" - did you forget to enable it when you configured PHP? in php shell code on line 1
<|eor|><|eols|><|endoftext|> | 9 |
lolphp | D1551D3N7 | e4dn1c1 | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>> PHP unserialization or object injection vulnerabilities were initially documented in 2009, which could allow an attacker to perform different kinds of attacks by supplying malicious inputs to the unserialize() PHP function.
It's not like there is [a big warning in the docs](https://secure.php.net/manual/en/function.unserialize.php) to not allow it to unserialize untrusted data.<|eor|><|soopr|>Yes but you don't have to be using phar (or serialization) for this to cause you problems. An attacker can abuse phar:// as a file handler if you have any functionality with file functions that a user can submit the full file path, like file_get_contents for instance.<|eoopr|><|sor|>> [PHP manual]: The phar stream wrapper does not operate on remote files, and cannot operate on remote files
This means you need to at least be able to somehow upload the archive to the server and be able to use the stream wrapper attack somewhere.
I'm wondering how bad this attack really is, because the images in the article show a typo3 cms admin console, which you normally don't just have access to as visitor.
> "The way certain thumbnail functionality within the application [WordPress] works enables an attacker with the privileges to upload and modify media items to gain sufficient control of the parameter used in a "file_exists" call to cause unserialization to occur," the researcher said.
The person who discovered this acknowledges that you need some level of access to the system already.
Looks like is't most useful as some sort of privilege escalation attack where you promote yourself to a full admin using a malicious archive but you already need some sort of write access.
The biggest gain in this is probably that you can now more universally automate tasks once you can upload and reference the archive.<|eor|><|soopr|>Yes you are correct. You would need to be able to upload files in someway and know the full path to them although he did say it may be possible to use PHP session files as well if you can control the first 100 bytes.
There's plenty of sites that don't require admin permissions to upload files, attachments or avatars for example. So I wouldn't say it's confined to authenticated scenarios.
I reckon we're going to see a good few CVEs from this.<|eoopr|><|eols|><|endoftext|> | 7 |
lolphp | sproingie | e4gsir3 | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>But you still need access to the server to actually "execute" the phar stream correct?
So its not that you can upload a jpeg to fx imgur and then execute it on a local server and then kill imgur?<|eor|><|sor|>No, but imagine an interface that blindly fetches arbitrary URLs, such as "url to your avatar image". It's terrible to write it that way in the first place given the leakage and DOS attacks possible, but more likely would be something like an admin backend, which tends to have fewer such checks, and can result in privilege escalation beyond what the backend would provide.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | AyrA_ch | e4dm28m | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>> PHP unserialization or object injection vulnerabilities were initially documented in 2009, which could allow an attacker to perform different kinds of attacks by supplying malicious inputs to the unserialize() PHP function.
It's not like there is [a big warning in the docs](https://secure.php.net/manual/en/function.unserialize.php) to not allow it to unserialize untrusted data.<|eor|><|soopr|>Yes but you don't have to be using phar (or serialization) for this to cause you problems. An attacker can abuse phar:// as a file handler if you have any functionality with file functions that a user can submit the full file path, like file_get_contents for instance.<|eoopr|><|sor|>> [PHP manual]: The phar stream wrapper does not operate on remote files, and cannot operate on remote files
This means you need to at least be able to somehow upload the archive to the server and be able to use the stream wrapper attack somewhere.
I'm wondering how bad this attack really is, because the images in the article show a typo3 cms admin console, which you normally don't just have access to as visitor.
> "The way certain thumbnail functionality within the application [WordPress] works enables an attacker with the privileges to upload and modify media items to gain sufficient control of the parameter used in a "file_exists" call to cause unserialization to occur," the researcher said.
The person who discovered this acknowledges that you need some level of access to the system already.
Looks like is't most useful as some sort of privilege escalation attack where you promote yourself to a full admin using a malicious archive but you already need some sort of write access.
The biggest gain in this is probably that you can now more universally automate tasks once you can upload and reference the archive.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | Takeoded | e4px9od | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>>make the file operation function access it using the "phar://" stream wrapper.
Uh, wait.... How is that possible? I wouldn't think one could ever do that from content, for example a CMS document, but only from a straight php file.<|eor|><|sor|>If the server calls [`fopen()`](http://php.net/manual/en/function.fopen.php) (or any other file-related function) with a user-defined path then it's an issue. Sometimes the client will provide the path as a relative path, like: `uploads/cmsimage.jpg` to the server. In the case of Typo3 it looked like this:
} elseif ($containsSlash || $isLocalFile) { // file (internal)
$splitLinkParam = explode('?', $link_param);
if (file_exists(rawurldecode($splitLinkParam[0])) ||
$isLocalFile) {
The `file_exists` method here just uses the URL parameter as an argument. Since the server doesn't specify a protocol, the client could in theory control the full path (including scheme).
I didn't check to see how the path is actually specified for Typo3 but I'm making the assumption that it's a relative path.<|eor|><|sor|>not often i need to do this, but last time i had a whitelist, something like
if(0!==strpos("/path/to/allowed_folder/",realpath($_POST['dir']))){invalid argument~~}
try breaking out of `/path/to/allowed_folder/` now.<|eor|><|sor|>`/path/to/allowed_folder/../../../etc/passwd`<|eor|><|sor|>sorry, realpath() would turn `/path/to/allowed_folder/../../../etc/passwd` into `/etc/passwd`, which would fail the strpos check.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | weirdasianfaces | e4fm82z | <|sols|><|sot|>New PHP Deserialization attack due to the phar:// file handler which can only be disabled by recompiling PHP<|eot|><|sol|>https://thehackernews.com/2018/08/php-deserialization-wordpress.html<|eol|><|sor|>>make the file operation function access it using the "phar://" stream wrapper.
Uh, wait.... How is that possible? I wouldn't think one could ever do that from content, for example a CMS document, but only from a straight php file.<|eor|><|sor|>If the server calls [`fopen()`](http://php.net/manual/en/function.fopen.php) (or any other file-related function) with a user-defined path then it's an issue. Sometimes the client will provide the path as a relative path, like: `uploads/cmsimage.jpg` to the server. In the case of Typo3 it looked like this:
} elseif ($containsSlash || $isLocalFile) { // file (internal)
$splitLinkParam = explode('?', $link_param);
if (file_exists(rawurldecode($splitLinkParam[0])) ||
$isLocalFile) {
The `file_exists` method here just uses the URL parameter as an argument. Since the server doesn't specify a protocol, the client could in theory control the full path (including scheme).
I didn't check to see how the path is actually specified for Typo3 but I'm making the assumption that it's a relative path.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | lmanata | 86avwq | <|sols|><|sot|>This fix to a dompdf error.<|eot|><|sol|>https://stackoverflow.com/questions/48436480/codeigniter-dom-pdf-no-block-level-parent-found-not-good<|eol|><|eols|><|endoftext|> | 32 |
lolphp | DCoder1337 | dw46whg | <|sols|><|sot|>This fix to a dompdf error.<|eot|><|sol|>https://stackoverflow.com/questions/48436480/codeigniter-dom-pdf-no-block-level-parent-found-not-good<|eol|><|sor|>If you think dompdf is bad, you should look at tcpdf. The fact that the entire tcpdf library is in [a single class spanning 26k lines is not the worst part](https://www.reddit.com/r/programminghorror/comments/4b3e9z/generating_pdfs_from_regexparsed_html_is/).<|eor|><|eols|><|endoftext|> | 26 |
lolphp | danabrey | dw49oea | <|sols|><|sot|>This fix to a dompdf error.<|eot|><|sol|>https://stackoverflow.com/questions/48436480/codeigniter-dom-pdf-no-block-level-parent-found-not-good<|eol|><|sor|>This is silly, but it's hardly PHP's fault. <|eor|><|eols|><|endoftext|> | 9 |
lolphp | thedarkhaze | dw4x4rz | <|sols|><|sot|>This fix to a dompdf error.<|eot|><|sol|>https://stackoverflow.com/questions/48436480/codeigniter-dom-pdf-no-block-level-parent-found-not-good<|eol|><|sor|>This is silly, but it's hardly PHP's fault. <|eor|><|sor|>True, but php tends to attract these problems and fixes.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | Takeoded | 7kllp3 | <|sols|><|sot|>should we generate an error when we fail to serialize something, or just return total utter garbage?<|eot|><|sol|>https://3v4l.org/hcPKv<|eol|><|eols|><|endoftext|> | 32 |
lolphp | tdammers | drf9hn3 | <|sols|><|sot|>should we generate an error when we fail to serialize something, or just return total utter garbage?<|eot|><|sol|>https://3v4l.org/hcPKv<|eol|><|sor|>Clearly, errors are always inconvenient, so those should be considered a last resort.
Equally clearly, if we are getting passed nonsensical arguments, the sane thing to do is to respond with nonsense. Programmers know best, so when they give us things that don't make sense, we must assume that they know what they are doing, and act accordingly.<|eor|><|eols|><|endoftext|> | 31 |
lolphp | barubary | drfgfen | <|sols|><|sot|>should we generate an error when we fail to serialize something, or just return total utter garbage?<|eot|><|sol|>https://3v4l.org/hcPKv<|eol|><|sor|>FWIW, it serializes as
string(4) "i:0;"<|eor|><|eols|><|endoftext|> | 8 |
lolphp | edave64 | drgwx17 | <|sols|><|sot|>should we generate an error when we fail to serialize something, or just return total utter garbage?<|eot|><|sol|>https://3v4l.org/hcPKv<|eol|><|sor|>I've run into a lot of situations, especially when interacting with hardware, where a return value of 0 means an error happened and you're supposed to check that yourself. I'm guessing that that's what's going on, but it's php so I have no clue. <|eor|><|sor|>But you can also serialize the number 0. So that return value isn't distinguishable from a valid value.<|eor|><|eols|><|endoftext|> | 7 |
lolphp | Takeoded | drih94j | <|sols|><|sot|>should we generate an error when we fail to serialize something, or just return total utter garbage?<|eot|><|sol|>https://3v4l.org/hcPKv<|eol|><|sor|>Last month we lost part of our production database because of this stupid behavior of PHP (with file_get_contents). Trust me, throwing an exception is ALWAYS preferrable to returning nonsense. It is just as bad as Visual Basic's On Error Resume Next. You cannot expect the programmer to always call a was_there_an_error_just_now_on_this_process() function after they call another function or check if the result is garbage.<|eor|><|soopr|>agreed. maybe that works for some programmers, but not for me. [(couple of years ago, i even thought of doing something about it, but i gave up)](https://github.com/divinity76/exphp), speaking of, heard of Google's "Go" lanuage? at first, it looked great.. but looking deeper, i found that it explicitly does not support exceptions :( you can kinda-sorta emulate the behavior using something called "Panic" and "Recover", but it's not the same, and much more clunky than try{}catch(){}..
the Go designers seriously expect programmers to __WANT__ to write this:
func DoStuff(a, b, c interface{}) error {
x, err := foo(a)
if err != nil {
return err
}
y, err := bar(b, x)
if err != nil {
return err
}
z, err := bax(c, x, y)
if err != nil {
return err
}
return baz(x, y, z)
}
instead of writing this:
func DoStuff(a, b, c interface{}) throws error {
x := foo(a)
y := bar(b, x)
baz(x, y, bax(c, x, y)
}
(which would have been roughly the equivalent code if Go supported exceptions, [source](http://hackthology.com/exceptions-for-go-as-a-library.html))
... which is why i ditched Go. <|eoopr|><|eols|><|endoftext|> | 5 |
lolphp | Takeoded | 6m8zdh | <|sols|><|sot|>only .ini ever parsed is php.ini, and parse_ini_string does not exist<|eot|><|sol|>https://bugs.php.net/bug.php?id=74603<|eol|><|eols|><|endoftext|> | 35 |
lolphp | Takeoded | djzs4nd | <|sols|><|sot|>only .ini ever parsed is php.ini, and parse_ini_string does not exist<|eot|><|sol|>https://bugs.php.net/bug.php?id=74603<|eol|><|soopr|>(this is according to stas@php.net and remi@php.net , and is a bit of a long read... but php core devs should have known better imo, and stas even removed the security category from the bug. luckily, i.wei re-added it)<|eoopr|><|eols|><|endoftext|> | 5 |
lolphp | nyamsprod | 6aq6km | <|soss|><|sot|>Pooh Separeted Value<|eot|><|sost|>So it seems that PHP used to be able to parse comma separated values with multibytes delimiter. Well I guess it was breaking things so a bug fix was released to remove the feature
https://3v4l.org/fP93h<|eost|><|eoss|><|endoftext|> | 31 |
lolphp | Deranged40 | dhgu7sf | <|soss|><|sot|>Pooh Separeted Value<|eot|><|sost|>So it seems that PHP used to be able to parse comma separated values with multibytes delimiter. Well I guess it was breaking things so a bug fix was released to remove the feature
https://3v4l.org/fP93h<|eost|><|sor|>pooh is a cartoon character who loves honey.
poo is what that emoticon is called.<|eor|><|eoss|><|endoftext|> | 33 |
lolphp | mohrt | dhh5fok | <|soss|><|sot|>Pooh Separeted Value<|eot|><|sost|>So it seems that PHP used to be able to parse comma separated values with multibytes delimiter. Well I guess it was breaking things so a bug fix was released to remove the feature
https://3v4l.org/fP93h<|eost|><|sor|>pooh is a cartoon character who loves honey.
poo is what that emoticon is called.<|eor|><|sor|>"pile of poo" to be exact<|eor|><|eoss|><|endoftext|> | 11 |
lolphp | flyingkiwi9 | dhhqtqk | <|soss|><|sot|>Pooh Separeted Value<|eot|><|sost|>So it seems that PHP used to be able to parse comma separated values with multibytes delimiter. Well I guess it was breaking things so a bug fix was released to remove the feature
https://3v4l.org/fP93h<|eost|><|sor|>pooh is a cartoon character who loves honey.
poo is what that emoticon is called.<|eor|><|sor|>Down voted OP for defacing pooh<|eor|><|eoss|><|endoftext|> | 7 |
lolphp | RodolpheB | 641du0 | <|sols|><|sot|>[not my discovery] Access a "private" property by casting an object into an array<|eot|><|sol|>https://3v4l.org/7rc9M<|eol|><|eols|><|endoftext|> | 33 |
lolphp | Laugarhraun | dfyrc1z | <|sols|><|sot|>[not my discovery] Access a "private" property by casting an object into an array<|eot|><|sol|>https://3v4l.org/7rc9M<|eol|><|sor|>It's an artefact of a clever implementation. Using a single hashtable for all object properties saves memory.
Though it's documented and become a feature. There's code which unfortunately relies on this.<|eor|><|sor|>Tbh you get the same you in various ways in all languages: anyone can do reflection, private and co. are only guidelines for the fellow developer.<|eor|><|eols|><|endoftext|> | 31 |
lolphp | duskwuff | dfyryjm | <|sols|><|sot|>[not my discovery] Access a "private" property by casting an object into an array<|eot|><|sol|>https://3v4l.org/7rc9M<|eol|><|sor|>It's an artefact of a clever implementation. Using a single hashtable for all object properties saves memory.
Though it's documented and become a feature. There's code which unfortunately relies on this.<|eor|><|sor|>Tbh you get the same you in various ways in all languages: anyone can do reflection, private and co. are only guidelines for the fellow developer.<|eor|><|sor|>Bingo. Thank you.
Visibility qualifiers (like `private`) are a safety feature to warn programmers away from depending on implementation details. They're not a security feature -- there are ways to bypass visibility qualifiers, and that's fine.<|eor|><|eols|><|endoftext|> | 23 |
lolphp | the_alias_of_andrea | dfylxez | <|sols|><|sot|>[not my discovery] Access a "private" property by casting an object into an array<|eot|><|sol|>https://3v4l.org/7rc9M<|eol|><|sor|>It's an artefact of a clever implementation. Using a single hashtable for all object properties saves memory.
Though it's documented and become a feature. There's code which unfortunately relies on this.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | bj_christianson | dfytfia | <|sols|><|sot|>[not my discovery] Access a "private" property by casting an object into an array<|eot|><|sol|>https://3v4l.org/7rc9M<|eol|><|sor|>Not sure this in itself is much of a Lol. as @SaraMG said in a followup to the tweet [you linked](https://www.reddit.com/r/lolphp/comments/641du0/not_my_discovery_access_a_private_property_by/dfylnav/), visibility is about telling users what they should do, not about security.
Now writing code that relies on it, as /u/the_alias_of_andrea [mentioned](https://www.reddit.com/r/lolphp/comments/641du0/not_my_discovery_access_a_private_property_by/dfylxez/), that is a Lol.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | myaut | 5kwot1 | <|sols|><|sot|>PHPMailer is still vulnerable for RCE because patch for CVE-2016-1033 didn't account for mail() own shell argument escaping<|eot|><|sol|>http://openwall.com/lists/oss-security/2016/12/28/4<|eol|><|eols|><|endoftext|> | 33 |
lolphp | sloat | dbr7uxd | <|sols|><|sot|>PHPMailer is still vulnerable for RCE because patch for CVE-2016-1033 didn't account for mail() own shell argument escaping<|eot|><|sol|>http://openwall.com/lists/oss-security/2016/12/28/4<|eol|><|sor|>Maybe I'm missing something, but if it's PHPMailer using the standard mail function... doesn't that mean the mail function is the vulnerability?<|eor|><|eols|><|endoftext|> | 15 |
lolphp | SirClueless | dbry458 | <|sols|><|sot|>PHPMailer is still vulnerable for RCE because patch for CVE-2016-1033 didn't account for mail() own shell argument escaping<|eot|><|sol|>http://openwall.com/lists/oss-security/2016/12/28/4<|eol|><|sor|>Maybe I'm missing something, but if it's PHPMailer using the standard mail function... doesn't that mean the mail function is the vulnerability?<|eor|><|sor|>According to the [first CVE](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html) they use the fifth `additional_parameters` parameter to `mail` which the documentation says requires further validation (which phpmailer did not do sufficiently).<|eor|><|sor|>OK, I see now. Rather than set the From header in the message body, they chose to use the -f switch for sendmail, for whatever reason.
<|eor|><|sor|>There are technical differences between the From header and the -f flag. The latter sets the actual envelope sender address, which is to say it's what controls the actual sender information in the SMTP protocol.
If you've ever gotten mail "From xyz@sender.com on behalf of somebody@example.com" this is what's going on: the From header was set to somebody@example.com and the the SMTP sender was xyz@sender.com.<|eor|><|eols|><|endoftext|> | 13 |
lolphp | yawkat | dbrn80l | <|sols|><|sot|>PHPMailer is still vulnerable for RCE because patch for CVE-2016-1033 didn't account for mail() own shell argument escaping<|eot|><|sol|>http://openwall.com/lists/oss-security/2016/12/28/4<|eol|><|sor|>Maybe I'm missing something, but if it's PHPMailer using the standard mail function... doesn't that mean the mail function is the vulnerability?<|eor|><|sor|>According to the [first CVE](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html) they use the fifth `additional_parameters` parameter to `mail` which the documentation says requires further validation (which phpmailer did not do sufficiently).<|eor|><|eols|><|endoftext|> | 11 |
lolphp | yxpow | dbsbavj | <|sols|><|sot|>PHPMailer is still vulnerable for RCE because patch for CVE-2016-1033 didn't account for mail() own shell argument escaping<|eot|><|sol|>http://openwall.com/lists/oss-security/2016/12/28/4<|eol|><|sor|>IDK why but I find this the most horrifying part of PHP, the fact that instead of actually implementing IMAP/SMTP properly they just wrote a wrapper around sendmail. Of course there's nothing wrong with using an external library to accomplish something but in my mind there's a much better way to do it that doesn't require an external program that you have no way to control. But what's worse is that there's a native IMAP/POP library (which I believe uses sockets and not an external program), yet there is no SMTP library that is implemented in the same way.
Actually it gets even worse. According to the docs, mail() doesn't use sendmail on Windows, so great portability. <|eor|><|eols|><|endoftext|> | 7 |
lolphp | sloat | dbroaq3 | <|sols|><|sot|>PHPMailer is still vulnerable for RCE because patch for CVE-2016-1033 didn't account for mail() own shell argument escaping<|eot|><|sol|>http://openwall.com/lists/oss-security/2016/12/28/4<|eol|><|sor|>Maybe I'm missing something, but if it's PHPMailer using the standard mail function... doesn't that mean the mail function is the vulnerability?<|eor|><|sor|>According to the [first CVE](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html) they use the fifth `additional_parameters` parameter to `mail` which the documentation says requires further validation (which phpmailer did not do sufficiently).<|eor|><|sor|>OK, I see now. Rather than set the From header in the message body, they chose to use the -f switch for sendmail, for whatever reason.
<|eor|><|eols|><|endoftext|> | 6 |
lolphp | bwoebi | 4rf4hf | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|eols|><|endoftext|> | 33 |
lolphp | RenaKunisaki | d51lfae | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|sor|>I think everyone knows this even if they don't know the technical implications. Always unset when using references!<|eor|><|sor|>Alternatively: Don't use PHP references. They're weird. :)<|eor|><|sor|>Alternatively: don't use PHP.<|eor|><|eols|><|endoftext|> | 15 |
lolphp | nikic | d50owkt | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|soopr|>TL;DR: It matters whether unset() of a reference happens before or after the first action on a copy.
Explanation:
In the first case:
$arr = array(1);
$r = &$arr[0];
$copy = $arr;
unset($r);
$copy[0]++; // trigger separation* here, AFTER unset()
var_dump($arr);
In the second case:
$arr = array(1);
$r = &$arr[0];
$copy = $arr;
$copy[0]++; // trigger separation* here, BEFORE unset()
unset($r);
var_dump($arr);
^* Separation is the process of creating a real copy after a "light" Copy on Write assignment.
PHP semantics require that a reference is automatically removed when its refcount drops to 1 (i.e. only one element is referencing it).
But, in the first case, due to the Copy on Write copy, the refcount of $arr is 2, while $arr[0] still has a refcount of 2 (instead of 3 as there are $copy[0], $arr[0] and $r referencing it). Thus, when unsetting $r, the refcount drops to 1 and the reference is removed. And then, upon separation, there is no reference anymore and $arr[0] and $copy[0] are manipulated independently.
In the second case however, $copy[0]++ triggers a separation with the reference still present (as $r still being a reference to $arr[0] and thus implicitly to $copy[0]), thus refcount is increased from 2 to 3. When $r is removed afterwards, refcount is dropped from 3 to 2 again and $arr[0] and $copy[0] still reference each other and hence share the same value.
Note: It'd be quite a significant performance impact to fix this one that's probably why it never has been fixed...<|eoopr|><|sor|>Tozawa et al. (POPL '09, 200-212) did some fairly extensive research on precisely this problem. They introduce a "mostly copy-on-write" scheme to avoid the problem.
You can find a PDF here: https://www.researchgate.net/profile/Yasuhiko_Minamide/publication/220997065_Copy-on-write_in_the_PHP_language/links/0fcfd5101e81b8a0c2000000.pdf<|eor|><|eols|><|endoftext|> | 14 |
lolphp | duskwuff | d5109wh | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|sor|>I think everyone knows this even if they don't know the technical implications. Always unset when using references!<|eor|><|sor|>Alternatively: Don't use PHP references. They're weird. :)<|eor|><|eols|><|endoftext|> | 12 |
lolphp | bwoebi | d50kstq | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|soopr|>TL;DR: It matters whether unset() of a reference happens before or after the first action on a copy.
Explanation:
In the first case:
$arr = array(1);
$r = &$arr[0];
$copy = $arr;
unset($r);
$copy[0]++; // trigger separation* here, AFTER unset()
var_dump($arr);
In the second case:
$arr = array(1);
$r = &$arr[0];
$copy = $arr;
$copy[0]++; // trigger separation* here, BEFORE unset()
unset($r);
var_dump($arr);
^* Separation is the process of creating a real copy after a "light" Copy on Write assignment.
PHP semantics require that a reference is automatically removed when its refcount drops to 1 (i.e. only one element is referencing it).
But, in the first case, due to the Copy on Write copy, the refcount of $arr is 2, while $arr[0] still has a refcount of 2 (instead of 3 as there are $copy[0], $arr[0] and $r referencing it). Thus, when unsetting $r, the refcount drops to 1 and the reference is removed. And then, upon separation, there is no reference anymore and $arr[0] and $copy[0] are manipulated independently.
In the second case however, $copy[0]++ triggers a separation with the reference still present (as $r still being a reference to $arr[0] and thus implicitly to $copy[0]), thus refcount is increased from 2 to 3. When $r is removed afterwards, refcount is dropped from 3 to 2 again and $arr[0] and $copy[0] still reference each other and hence share the same value.
Note: It'd be quite a significant performance impact to fix this one that's probably why it never has been fixed...<|eoopr|><|eols|><|endoftext|> | 10 |
lolphp | FredL2 | d5276ef | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|sor|>I love how 5.4.15 just crashes for good measure<|eor|><|eols|><|endoftext|> | 9 |
lolphp | bwoebi | d532t68 | <|sols|><|sot|>Copy on Write is not fully transparent with references; broken since forever<|eot|><|sol|>https://3v4l.org/iOC9I<|eol|><|soopr|>TL;DR: It matters whether unset() of a reference happens before or after the first action on a copy.
Explanation:
In the first case:
$arr = array(1);
$r = &$arr[0];
$copy = $arr;
unset($r);
$copy[0]++; // trigger separation* here, AFTER unset()
var_dump($arr);
In the second case:
$arr = array(1);
$r = &$arr[0];
$copy = $arr;
$copy[0]++; // trigger separation* here, BEFORE unset()
unset($r);
var_dump($arr);
^* Separation is the process of creating a real copy after a "light" Copy on Write assignment.
PHP semantics require that a reference is automatically removed when its refcount drops to 1 (i.e. only one element is referencing it).
But, in the first case, due to the Copy on Write copy, the refcount of $arr is 2, while $arr[0] still has a refcount of 2 (instead of 3 as there are $copy[0], $arr[0] and $r referencing it). Thus, when unsetting $r, the refcount drops to 1 and the reference is removed. And then, upon separation, there is no reference anymore and $arr[0] and $copy[0] are manipulated independently.
In the second case however, $copy[0]++ triggers a separation with the reference still present (as $r still being a reference to $arr[0] and thus implicitly to $copy[0]), thus refcount is increased from 2 to 3. When $r is removed afterwards, refcount is dropped from 3 to 2 again and $arr[0] and $copy[0] still reference each other and hence share the same value.
Note: It'd be quite a significant performance impact to fix this one that's probably why it never has been fixed...<|eoopr|><|sor|>Wait wait wait. So you are saying that ordinary assignment
$a = array();
$b = $a;
Does not *actually* do a deep copy? It does some weird half-assed copy-on-write whose exact behave depends on the reference count of ... not only the array, but items in the array? ... what?
I tried calling my new friend `debug_zval_dump` in a few really simple cases and now I am hopelessly confused.
Also why is the reference count of `$a` and `$b` 3 not 2?
$ php -a
php > $a = array(); $b = $a;
php > debug_zval_dump($a);
array(0) refcount(3){
}
php > debug_zval_dump($b);
array(0) refcount(3){
}
Okay that first one actually makes sense. It seems like the reference count of the zval should also be 1 in the second case though ... otherwise how would the reference count reach zero when the variable goes out of scope?
$ php -r 'debug_zval_dump(array())'
php -r 'debug_zval_dump(array());'
array(0) refcount(1){
}
$ php -r '$a = array(); debug_zval_dump($a);'
array(0) refcount(2){
}<|eor|><|soopr|>uh `debug_zval_dump()` use with caution. Note that passing a value as parameter also increments its refcount. [which you seem to not have accounted for.]
The refcount only depends on the array, and that's the issue - it does not account for the case where the refcount of possibly retained references in the array changes between CoW and separation.<|eoopr|><|eols|><|endoftext|> | 5 |
lolphp | Sebbe | 3pil1g | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|eols|><|endoftext|> | 34 |
lolphp | duskwuff | cw6nu6c | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|sor|>No, it doesn't.
[This nonstandard PHP extension](https://github.com/krakjoe/uopz) allows you to redefine opcodes at runtime. Which actually isn't all that unreasonable of a thing to do in certain unit testing scenarios. (In particular, it makes it possible to mock PHP's builtin functions.)<|eor|><|eols|><|endoftext|> | 51 |
lolphp | sloat | cw6shyk | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|sor|>No, it doesn't.
[This nonstandard PHP extension](https://github.com/krakjoe/uopz) allows you to redefine opcodes at runtime. Which actually isn't all that unreasonable of a thing to do in certain unit testing scenarios. (In particular, it makes it possible to mock PHP's builtin functions.)<|eor|><|sor|>They could make that more clear by not hosting the documentation.
As a side note, arrays, classes, and other functions [are also listed as extensions](http://php.net/manual/en/refs.basic.vartype.php) in the documentation.<|eor|><|eols|><|endoftext|> | 17 |
lolphp | duskwuff | cw70975 | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|sor|>No, it doesn't.
[This nonstandard PHP extension](https://github.com/krakjoe/uopz) allows you to redefine opcodes at runtime. Which actually isn't all that unreasonable of a thing to do in certain unit testing scenarios. (In particular, it makes it possible to mock PHP's builtin functions.)<|eor|><|sor|>They could make that more clear by not hosting the documentation.
As a side note, arrays, classes, and other functions [are also listed as extensions](http://php.net/manual/en/refs.basic.vartype.php) in the documentation.<|eor|><|sor|>> They could make that more clear by not hosting the documentation.
Yeah, that's a kind of a historical mistake: for some reason, the official PHP documentation includes documentation for a bunch of PECL extensions which aren't distributed with PHP, and which aren't developed by PHP core developers. I don't claim to understand it, but I'm sure they have their reasons. :/
[This page lists the extensions (and "extensions") in a clearer fashion.](http://php.net/manual/en/extensions.membership.php)<|eor|><|eols|><|endoftext|> | 15 |
lolphp | mythril | cw6xx4c | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|sor|>No, it doesn't.
[This nonstandard PHP extension](https://github.com/krakjoe/uopz) allows you to redefine opcodes at runtime. Which actually isn't all that unreasonable of a thing to do in certain unit testing scenarios. (In particular, it makes it possible to mock PHP's builtin functions.)<|eor|><|sor|>I didn't think you needed an extension to mock PHP's builtin functions.<|eor|><|sor|>Depends how extensively you wish to mock said builtin functions.<|eor|><|eols|><|endoftext|> | 13 |
lolphp | bart2019 | cw7d931 | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|sor|>Actually I think that's very cool.<|eor|><|eols|><|endoftext|> | 11 |
lolphp | xardas_eu | cw7lgva | <|sols|><|sot|>So, apparently PHP lets you redefine its VM opcodes... from within the language itself.<|eot|><|sol|>http://php.net/manual/en/function.uopz-overload.php<|eol|><|sor|>so we're bashing PECL extensions again... just wait till /u/Sebbe finds classkit, runkit or pcntl...
shitpost.<|eor|><|eols|><|endoftext|> | 7 |
lolphp | BowserKoopa | 3ki25f | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|eols|><|endoftext|> | 32 |
lolphp | duskwuff | cuxn2z9 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>[If you think that's a bad idea](http://gtk.php.net/)<|eor|><|eols|><|endoftext|> | 30 |
lolphp | FredL2 | cuyghm1 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>It's NaN o'clock. Time to go home!<|eor|><|sor|>Good morning!Good evening!Good night!Warning: invalid argument supplied for foreach()battery is percent<|eor|><|eols|><|endoftext|> | 28 |
lolphp | esquilax | cuxzebi | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>It's NaN o'clock. Time to go home!<|eor|><|eols|><|endoftext|> | 21 |
lolphp | BowserKoopa | cuxxys9 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>[If you think that's a bad idea](http://gtk.php.net/)<|eor|><|soopr|>Oh trust me. I've seen that.
And I have also seen the OpenGL API for PHP.<|eoopr|><|eols|><|endoftext|> | 18 |
lolphp | TheBananaKing | cuxo9es | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>"Configuration is stored in a PHP array..."
oh god oh god oh god oh god oh god<|eor|><|eols|><|endoftext|> | 17 |
lolphp | polish_niceguy | cuxqmbx | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>"Configuration is stored in a PHP array..."
oh god oh god oh god oh god oh god<|eor|><|sor|>What's wrong with this?<|eor|><|sor|>Apart from anything else, it means it's going to be include()ed and executed....
<|eor|><|sor|>I have no idea what this i3phatus is, but I assume that config files are modified only by the app owner. Then, what's the problem?
Most popular frameworks store their configuration in php files. There's almost no overhead and great flexibility.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | Max-P | cuxqob0 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>I honestly think this is not much worse than using bash or Python. It's a simple and not too obscure language, you can do things quickly with it. And it works fine for that, I like to use PHP as a small upgrade when bash doesn't cut it (and I hate python and don't have ruby installed). Sure, I could make a C/C++/D/Rust/Go program and all, but it's overkill and not worth the effort for a simple 300 lines remote backup script that takes 5 minutes to write in PHP. If this guy has PHP already on his system and knows the language, why not? It's just spitting text for i3 to display anyway, it *is* the kind of scripts it was designed for.
What PHP was *not* made for is the huge millions of files web applications we see nowadays. Neither is it suitable to write a websocket server, or a GUI app. Or anything that's not just dumping a bunch of forms in a database really. Nobody sane would have designed a language *meant* to be used the way PHP is abused today. What makes PHP so horrible is the patchwork to retrofit features over features while breaking as less as possible. <|eor|><|eols|><|endoftext|> | 13 |
lolphp | eat_more_soup | cuyizpw | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>I honestly think this is not much worse than using bash or Python. It's a simple and not too obscure language, you can do things quickly with it. And it works fine for that, I like to use PHP as a small upgrade when bash doesn't cut it (and I hate python and don't have ruby installed). Sure, I could make a C/C++/D/Rust/Go program and all, but it's overkill and not worth the effort for a simple 300 lines remote backup script that takes 5 minutes to write in PHP. If this guy has PHP already on his system and knows the language, why not? It's just spitting text for i3 to display anyway, it *is* the kind of scripts it was designed for.
What PHP was *not* made for is the huge millions of files web applications we see nowadays. Neither is it suitable to write a websocket server, or a GUI app. Or anything that's not just dumping a bunch of forms in a database really. Nobody sane would have designed a language *meant* to be used the way PHP is abused today. What makes PHP so horrible is the patchwork to retrofit features over features while breaking as less as possible. <|eor|><|sor|>Discrediting python or ruby does not help your argument however. Any sane language is good enough for small jobs.<|eor|><|eols|><|endoftext|> | 11 |
lolphp | Kwpolska | cuz46g2 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>I honestly think this is not much worse than using bash or Python. It's a simple and not too obscure language, you can do things quickly with it. And it works fine for that, I like to use PHP as a small upgrade when bash doesn't cut it (and I hate python and don't have ruby installed). Sure, I could make a C/C++/D/Rust/Go program and all, but it's overkill and not worth the effort for a simple 300 lines remote backup script that takes 5 minutes to write in PHP. If this guy has PHP already on his system and knows the language, why not? It's just spitting text for i3 to display anyway, it *is* the kind of scripts it was designed for.
What PHP was *not* made for is the huge millions of files web applications we see nowadays. Neither is it suitable to write a websocket server, or a GUI app. Or anything that's not just dumping a bunch of forms in a database really. Nobody sane would have designed a language *meant* to be used the way PHP is abused today. What makes PHP so horrible is the patchwork to retrofit features over features while breaking as less as possible. <|eor|><|sor|>Discrediting python or ruby does not help your argument however. Any sane language is good enough for small jobs.<|eor|><|sor|>Oh I'm in no way discrediting them. They're both miles ahead of PHP in my opinion. I just said I don't like Python (personal taste), that I didn't have Ruby installed (have nothing installed that uses it), and that PHP is good enough to read a few text files and format it (already have it because webdev, already know it too). I'm not even discrediting bash either: it does what it needs to do fine.<|eor|><|sor|>Python and/or Ruby are more likely to be installed on desktops than PHP.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | phoshi | cuxsx8s | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>"Configuration is stored in a PHP array..."
oh god oh god oh god oh god oh god<|eor|><|sor|>What's wrong with this?<|eor|><|sor|>Apart from anything else, it means it's going to be include()ed and executed....
<|eor|><|sor|>I have no idea what this i3phatus is, but I assume that config files are modified only by the app owner. Then, what's the problem?
Most popular frameworks store their configuration in php files. There's almost no overhead and great flexibility.<|eor|><|sor|>A Web server's security model includes running zero third party code with permissions. A desktop environment's security model includes running lots of third party code with permissions. Configuration could well be writable by the user, which would be a significant attack vector. <|eor|><|eols|><|endoftext|> | 10 |
lolphp | polish_niceguy | cuxpupe | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>"Configuration is stored in a PHP array..."
oh god oh god oh god oh god oh god<|eor|><|sor|>What's wrong with this?<|eor|><|eols|><|endoftext|> | 8 |
lolphp | TheBananaKing | cuxqj8n | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>"Configuration is stored in a PHP array..."
oh god oh god oh god oh god oh god<|eor|><|sor|>What's wrong with this?<|eor|><|sor|>Apart from anything else, it means it's going to be include()ed and executed....
<|eor|><|eols|><|endoftext|> | 8 |
lolphp | kageurufu | cuy3sr9 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>"Configuration is stored in a PHP array..."
oh god oh god oh god oh god oh god<|eor|><|sor|>What's wrong with this?<|eor|><|sor|>Apart from anything else, it means it's going to be include()ed and executed....
<|eor|><|sor|>I have no idea what this i3phatus is, but I assume that config files are modified only by the app owner. Then, what's the problem?
Most popular frameworks store their configuration in php files. There's almost no overhead and great flexibility.<|eor|><|sor|>A Web server's security model includes running zero third party code with permissions. A desktop environment's security model includes running lots of third party code with permissions. Configuration could well be writable by the user, which would be a significant attack vector. <|eor|><|sor|>so is writing to .bashrc, and a much more common vector.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | FredL2 | cuxnddz | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>No! Not my i3! Please!<|eor|><|eols|><|endoftext|> | 7 |
lolphp | Max-P | cuyko43 | <|sols|><|sot|>Oh god. It's leaking in to the desktop realm.<|eot|><|sol|>https://github.com/mwgg/i3phtatus<|eol|><|sor|>I honestly think this is not much worse than using bash or Python. It's a simple and not too obscure language, you can do things quickly with it. And it works fine for that, I like to use PHP as a small upgrade when bash doesn't cut it (and I hate python and don't have ruby installed). Sure, I could make a C/C++/D/Rust/Go program and all, but it's overkill and not worth the effort for a simple 300 lines remote backup script that takes 5 minutes to write in PHP. If this guy has PHP already on his system and knows the language, why not? It's just spitting text for i3 to display anyway, it *is* the kind of scripts it was designed for.
What PHP was *not* made for is the huge millions of files web applications we see nowadays. Neither is it suitable to write a websocket server, or a GUI app. Or anything that's not just dumping a bunch of forms in a database really. Nobody sane would have designed a language *meant* to be used the way PHP is abused today. What makes PHP so horrible is the patchwork to retrofit features over features while breaking as less as possible. <|eor|><|sor|>Discrediting python or ruby does not help your argument however. Any sane language is good enough for small jobs.<|eor|><|sor|>Oh I'm in no way discrediting them. They're both miles ahead of PHP in my opinion. I just said I don't like Python (personal taste), that I didn't have Ruby installed (have nothing installed that uses it), and that PHP is good enough to read a few text files and format it (already have it because webdev, already know it too). I'm not even discrediting bash either: it does what it needs to do fine.<|eor|><|eols|><|endoftext|> | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.