subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
lolphp | dtfinch | d5gygsc | <|sols|><|sot|>In retrospect having the function return an integer maybe wasn't the best idea<|eot|><|sol|>https://secure.php.net/manual/en/function.crc32.php<|eol|><|sor|>Or they could have just had it return signed on both 32 and 64 bit.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | losingthefight | d5ht2bu | <|sols|><|sot|>In retrospect having the function return an integer maybe wasn't the best idea<|eot|><|sol|>https://secure.php.net/manual/en/function.crc32.php<|eol|><|sor|>At least someone had the courtesy of making a big **BASICALLY, DON'T USE THIS** disclaimer in the API. And even if you must use it, there's a detailed description of how to get around the 32 vs 64 bit problem.
It's easy to judge legacy features and code. ;)<|eor|><|sor|>>BASICALLY, DON'T USE THIS disclaimer in the API..
Would have been great if they put it in the header of php.net, for the whole language..<|eor|><|sor|>Haters gonna hate. The world would've been a very different place without the PHP language. Mistakes were made, indeed, but it more than makes up for it in availability, open-source projects, high-profile websites running it, etc.<|eor|><|sor|>And the world would be different without COBOL or FORTRAN. Doesn't mean we should still be using them for new systems. New tools arise and replace old ones. Not sure that PHP has any real advantage over other options in the current environment, other than the legacy install base.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | phaeilo | 1yseqm | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|eols|><|endoftext|> | 86 |
lolphp | cfreak2399 | cfnf9c8 | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>The good news is the author commented after they showed him the error of his ways and is working to fix the problem.<|eor|><|eols|><|endoftext|> | 51 |
lolphp | InconsiderateBastard | cfnlnpo | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>The good news is the author commented after they showed him the error of his ways and is working to fix the problem.<|eor|><|sor|>I expected drama, but instead found someone learning from constructive criticism. <|eor|><|eols|><|endoftext|> | 34 |
lolphp | dafragsta | cfnp3ta | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>PHP has a way of shutting that kind of thing down.<|eor|><|eols|><|endoftext|> | 28 |
lolphp | dehrmann | cfni02r | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>He's probably thinking of ["magic quotes"](http://www.php.net/magic_quotes), that used to put a backslash in front of every dangerous character in script parameters, with the following nasty side effects:
1) It only worked for Mysql, it's not standard SQL so other databases use different escaping mechanisms
2) If you need to use the data for other purposes than inserting into Mysql, you're f*cked.
<|eor|><|sor|>What's most telling about magic quotes is the PHP developers thought they were a good idea.<|eor|><|eols|><|endoftext|> | 24 |
lolphp | bart2019 | cfnc5op | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>He's probably thinking of ["magic quotes"](http://www.php.net/magic_quotes), that used to put a backslash in front of every dangerous character in script parameters, with the following nasty side effects:
1) It only worked for Mysql, it's not standard SQL so other databases use different escaping mechanisms
2) If you need to use the data for other purposes than inserting into Mysql, you're f*cked.
<|eor|><|eols|><|endoftext|> | 17 |
lolphp | mort96 | cfncd8z | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>He's probably thinking of ["magic quotes"](http://www.php.net/magic_quotes), that used to put a backslash in front of every dangerous character in script parameters, with the following nasty side effects:
1) It only worked for Mysql, it's not standard SQL so other databases use different escaping mechanisms
2) If you need to use the data for other purposes than inserting into Mysql, you're f*cked.
<|eor|><|sor|>I thought he was thinking of how `mysqli->query` (and presumably `mysql_query`) can only execute one query, even if you give it
`$mysqli->query("select * from students; drop table students")`
it will just execute the first statement. (Shoot me if I'm wrong, but I think that's how it works.)
Of corse, that's irrelevant, as he used multi_query and not query - multi_query does allow multiple queries separated by a semicolon. Also, it would of corse be no excuse to escape, or better, use prepared statements.<|eor|><|eols|><|endoftext|> | 17 |
lolphp | epsy | cfnqgnk | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>The good news is the author commented after they showed him the error of his ways and is working to fix the problem.<|eor|><|sor|>I expected drama, but instead found someone learning from constructive criticism. <|eor|><|sor|>Then github users start spamming image macros after it.<|eor|><|eols|><|endoftext|> | 16 |
lolphp | bgeron | cfno1j8 | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>Oh noes, if they keep improving like this, we'll run out of jokes in no time!
/s<|eor|><|eols|><|endoftext|> | 11 |
lolphp | MonadicTraversal | cfo6h5x | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>The good news is the author commented after they showed him the error of his ways and is working to fix the problem.<|eor|><|sor|>I expected drama, but instead found someone learning from constructive criticism. <|eor|><|sor|>Then github users start spamming image macros after it.<|eor|><|sor|>Inline images in Github comments is such an awful thing.<|eor|><|eols|><|endoftext|> | 11 |
lolphp | fphhotchips | cfo2lz7 | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>This is mostly the original developer's noobishness rather than a PHP problem, but "only mostly." You gotta love that false sense of security!<|eor|><|sor|>Current doc pages have a "This extension is deprecated as of PHP 5.5.0" warning. IHMO all `mysql` doc pages deserve another warning saying "Using this extension in any way poses _severe_ security risks."<|eor|><|sor|>*all PHP doc pages.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | pcopley | cfnbqfr | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>Holy shit<|eor|><|eols|><|endoftext|> | 9 |
lolphp | EvilTerran | cfnff4i | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>I thought only ~~PDO~~ prepared statements prevent (first-level) SQL injection automatically.<|eor|><|sor|>Parametrised queries are the thing. You don't necessarily have to prepare them (but it's good practice).<|eor|><|eols|><|endoftext|> | 9 |
lolphp | Rainfly_X | cfnjxmq | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>This is mostly the original developer's noobishness rather than a PHP problem, but "only mostly." You gotta love that false sense of security!<|eor|><|eols|><|endoftext|> | 8 |
lolphp | berkes | cfo4t73 | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>I'm answering some PHP-questions on stacoverflow now and then. It's absolutely astonishing how many SQL- injections, people post there. In questions having nothing to do with security, that is.
The amount of times you have to comment that example code or answers introduce injections, use deprecated functions is worrying.
And yes, this is a problem with newbies in PHP mostly. Ruby or Python noobs are either protected better by default, or learn about this earlier on, I don't know. In any case: i've never had tot point out a sql-injection or xss-hole in some Ruby (or Rails) question ever, yet.<|eor|><|eols|><|endoftext|> | 7 |
lolphp | Jonno_FTW | cfnfvov | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>It's shit like this, PHP...<|eor|><|sor|>I think you mean beginner programmers.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | djsumdog | cfok0tz | <|sols|><|sot|>No need to worry: PHP stops SQL injection by default!<|eot|><|sol|>https://github.com/BarrensZeppelin/ltglan/issues/1<|eol|><|sor|>The good news is the author commented after they showed him the error of his ways and is working to fix the problem.<|eor|><|sor|>I expected drama, but instead found someone learning from constructive criticism. <|eor|><|sor|>Then github users start spamming image macros after it.<|eor|><|sor|>Inline images in Github comments is such an awful thing.<|eor|><|sor|>I can see a purpose to it if you're attaching a screenshot of an issue. Treating it like a Reddit thread isn't the most mature thing to do. <|eor|><|eols|><|endoftext|> | 6 |
lolphp | Cameron_D | 1pnqbk | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|eols|><|endoftext|> | 87 |
lolphp | infinull | cd45w5b | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|eols|><|endoftext|> | 38 |
lolphp | edwardly | cd46s7q | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|sor|>Yes.... however the inconsistency is not good. At all.
Either it should return a consistent result or it should throw an exception/return false. There isn't much excuse for this case<|eor|><|sor|>It does return false on PHP 5.1.0-5.1.6, if you'd look into it. The result of January is caused by PHP's type casting of false to 0, and then using it as a unix timestamp of 0.
PHP 4-5.0.5 returns -1. Unix timestamp of -1 sounds pretty dumb (it is) but it would be december.
PHP 5.1.6 was 7 years ago, to be fair.<|eor|><|eols|><|endoftext|> | 18 |
lolphp | merreborn | cd47tfz | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>It's a little more clear what's happening here: http://3v4l.org/bvfOF<|eor|><|eols|><|endoftext|> | 17 |
lolphp | merreborn | cd47xfz | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|sor|>I was under the impression that strotime, like most PHP functions, was just a thin wrapper around some old C lib.
Looks like most of the behavior of PHP's `strtotime()` is based on the GNU C `parse_datetime()` function.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | PhantomRacer | cd4dgmi | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>It's a little more clear what's happening here: http://3v4l.org/bvfOF<|eor|><|sor|>Even more clear here: http://3v4l.org/7Ho9K<|eor|><|eols|><|endoftext|> | 13 |
lolphp | Daniel15 | cd4hsln | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Not really shown well here, strtotime("February") returns a timestamp in March if you run it past the 28th of the month. Seems it uses the current day, not 1st February. <|eor|><|eols|><|endoftext|> | 10 |
lolphp | Cameron_D | cd478si | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|sor|>Yes.... however the inconsistency is not good. At all.
Either it should return a consistent result or it should throw an exception/return false. There isn't much excuse for this case<|eor|><|sor|>It does return false on PHP 5.1.0-5.1.6, if you'd look into it. The result of January is caused by PHP's type casting of false to 0, and then using it as a unix timestamp of 0.
PHP 4-5.0.5 returns -1. Unix timestamp of -1 sounds pretty dumb (it is) but it would be december.
PHP 5.1.6 was 7 years ago, to be fair.<|eor|><|soopr|>Ah, that makes sense. I knew that wold be a reasonable-ish explanation as to why it does it. Funny nonetheless.<|eoopr|><|eols|><|endoftext|> | 10 |
lolphp | Cameron_D | cd496n9 | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|sor|>Yes.... however the inconsistency is not good. At all.
Either it should return a consistent result or it should throw an exception/return false. There isn't much excuse for this case<|eor|><|sor|>It does return false on PHP 5.1.0-5.1.6, if you'd look into it. The result of January is caused by PHP's type casting of false to 0, and then using it as a unix timestamp of 0.
PHP 4-5.0.5 returns -1. Unix timestamp of -1 sounds pretty dumb (it is) but it would be december.
PHP 5.1.6 was 7 years ago, to be fair.<|eor|><|soopr|>Ah, that makes sense. I knew that wold be a reasonable-ish explanation as to why it does it. Funny nonetheless.<|eoopr|><|sor|>> makes sense
> reasonable-ish
Uh No. Sorry, but that is not reasonable-ish. :-P<|eor|><|soopr|>Weeeellll, returning false makes sense in PHPland (an exception would be better, but this is PHP we're talking about), and 0 being the result of casting false to an integer is understandable.<|eoopr|><|eols|><|endoftext|> | 8 |
lolphp | Grinnz | cdfb0s8 | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|sor|>http://search.cpan.org/~gbarr/TimeDate-2.30/lib/Date/Parse.pm
"parse this for me with no idea about how it's formatted" is another name for Perl.<|eor|><|eols|><|endoftext|> | 7 |
lolphp | Daniel15 | cd4hrjj | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>[deleted]<|eor|><|sor|>strtotime("February") returns a timestamp in March if you run it past the 28th of the month. It uses the current day, not 1st February. <|eor|><|eols|><|endoftext|> | 6 |
lolphp | edwardly | cd4imjy | <|sols|><|sot|>strtotime("February")<|eot|><|sol|>http://3v4l.org/XXbtf<|eol|><|sor|>Are there any other languages that have a "parse this date for me, no I won't give you any idea about how it's formatted," function?
Maybe that's because it's *really* hard to get it to work right?
Maybe it isn't a thing you should do?
Maybe.<|eor|><|sor|>Yes.... however the inconsistency is not good. At all.
Either it should return a consistent result or it should throw an exception/return false. There isn't much excuse for this case<|eor|><|sor|>It does return false on PHP 5.1.0-5.1.6, if you'd look into it. The result of January is caused by PHP's type casting of false to 0, and then using it as a unix timestamp of 0.
PHP 4-5.0.5 returns -1. Unix timestamp of -1 sounds pretty dumb (it is) but it would be december.
PHP 5.1.6 was 7 years ago, to be fair.<|eor|><|sor|>PHP 5.1 is still the standard on RHEL 5 and will be for another decade or so.<|eor|><|sor|>Which also came out around 7 years ago.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | captainramen | 5sotbs | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|eols|><|endoftext|> | 86 |
lolphp | stumpychubbins | ddhbg8l | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>The 3 values of logical computation: `true`, `false` and `bad_alloc`<|eor|><|eols|><|endoftext|> | 54 |
lolphp | Cuddlefluff_Grim | ddhaqmq | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>`tralse`<|eor|><|eols|><|endoftext|> | 35 |
lolphp | emilvikstrom | ddi4j5h | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>The 3 values of logical computation: `true`, `false` and `bad_alloc`<|eor|><|sor|>`True`, `False` [and](http://thedailywtf.com/articles/What_Is_Truth_0x3f_) `FileNotFound`<|eor|><|eols|><|endoftext|> | 18 |
lolphp | vytah | ddgvwzt | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>[deleted]<|eor|><|sor|>4.3.10 is from 14 Dec 2004.
5.0.3 is from 15 Dec 2004.
7.0.13 is from 10 Nov 2016.
So it was patched twice, 12 years apart.<|eor|><|eols|><|endoftext|> | 18 |
lolphp | bart2019 | ddheqxi | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>I don't get it.
So the team patched it, and decided that `is_nan((float)'NAN')` should be **false**?
Oh, wait... :
var_dump((float)"NAN");
yields
double(0)
Uh... Okay... I guess...
So how do you enter NaN?
<|eor|><|eols|><|endoftext|> | 17 |
lolphp | stumpychubbins | ddi5be6 | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>JS classic: `typeof NaN`<|eor|><|sor|>This one makes a twisted sense though, it's just linguistically funny <|eor|><|eols|><|endoftext|> | 17 |
lolphp | prewk | ddhys8m | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>JS classic: `typeof NaN`<|eor|><|eols|><|endoftext|> | 13 |
lolphp | the_alias_of_andrea | ddhmzyx | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>I don't get it.
So the team patched it, and decided that `is_nan((float)'NAN')` should be **false**?
Oh, wait... :
var_dump((float)"NAN");
yields
double(0)
Uh... Okay... I guess...
So how do you enter NaN?
<|eor|><|sor|>You don't, at least not with the float-parsing functions.
There's a `NAN` constant, though.<|eor|><|eols|><|endoftext|> | 9 |
lolphp | nikic | ddl4svp | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>For context, for PHP 7.0.0 the strtod implementation was updated and during that update a macro was incorrectly configured, leading to strings starting with `INF` or `NAN` being parsed into the INF and NAN floating-point values. This change in behavior was not intentional, so was undone when it was reported.<|eor|><|eols|><|endoftext|> | 7 |
lolphp | stumpychubbins | ddi58q1 | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>The 3 values of logical computation: `true`, `false` and `bad_alloc`<|eor|><|sor|>`True`, `False` [and](http://thedailywtf.com/articles/What_Is_Truth_0x3f_) `FileNotFound`<|eor|><|sor|>That was exactly what I was referencing!<|eor|><|eols|><|endoftext|> | 7 |
lolphp | captainramen | ddiu9f4 | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>I don't get it.
So the team patched it, and decided that `is_nan((float)'NAN')` should be **false**?
Oh, wait... :
var_dump((float)"NAN");
yields
double(0)
Uh... Okay... I guess...
So how do you enter NaN?
<|eor|><|soopr|>I'm not sure that they decided anything. My guess is, they were fixing bugs elsewhere and this was just a side effect.<|eoopr|><|eols|><|endoftext|> | 6 |
lolphp | prewk | ddi8qqu | <|sols|><|sot|>is_nan((float)'NAN')? PHP Can't Decide<|eot|><|sol|>https://3v4l.org/0Jeva<|eol|><|sor|>JS classic: `typeof NaN`<|eor|><|sor|>This one makes a twisted sense though, it's just linguistically funny <|eor|><|sor|>Hehe yeah, it's still funny though.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | captainramen | lwbudo | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|eols|><|endoftext|> | 83 |
lolphp | AyrA_ch | gpghhzd | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|eols|><|endoftext|> | 55 |
lolphp | BitcoinCitadel | gpgt5yx | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|sor|>Yeah wtf, linux doesn't even come with PHP. What the hell uses PHP on mac out of the box<|eor|><|eols|><|endoftext|> | 42 |
lolphp | mort96 | gpgkh24 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|eols|><|endoftext|> | 34 |
lolphp | feketegy | gpglp6o | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>"Not recommended... instead use xcode and buy an Apple developer license" :)
There, I completed the sentence.<|eor|><|eols|><|endoftext|> | 23 |
lolphp | mort96 | gpgnjku | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>But the meaning is that the OS included PHP isn't recommended, so what's the problem? Relying on a built in whatever-version of PHP is stupid to begin with.<|eor|><|sor|>I get that it can be read that way. But the words are: "PHP is not recommended". Not "This version of PHP is not recommended", not "Using the system version of PHP is not recommended", just "PHP is not recommended". It probably wasn't meant to say that PHP is not recommended in general, but that's what it actually says.<|eor|><|eols|><|endoftext|> | 22 |
lolphp | commitpushdrink | gpix4xc | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>"Not recommended... instead use xcode and buy an Apple developer license" :)
There, I completed the sentence.<|eor|><|sor|>"PHP is not recommended" was already perfect<|eor|><|sor|>Why?<|eor|><|sor|>Youre in a sub dedicated to making fun of it.
Why do you think?<|eor|><|eols|><|endoftext|> | 22 |
lolphp | prewk | gpgmu0o | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>But the meaning is that the OS included PHP isn't recommended, so what's the problem? Relying on a built in whatever-version of PHP is stupid to begin with.<|eor|><|eols|><|endoftext|> | 18 |
lolphp | Miserable_Fuck | gpgvzsz | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>"Not recommended... instead use xcode and buy an Apple developer license" :)
There, I completed the sentence.<|eor|><|sor|>"PHP is not recommended" was already perfect<|eor|><|eols|><|endoftext|> | 17 |
lolphp | captainramen | gpgf2mf | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|soopr|>More of a lolphpengineer but still<|eoopr|><|eols|><|endoftext|> | 15 |
lolphp | captainramen | gpigoh2 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|soopr|>Windows doesn't even come with the dotnet sdk integrated<|eoopr|><|eols|><|endoftext|> | 14 |
lolphp | jeankev | gpijxg4 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|sor|>Yeah wtf, linux doesn't even come with PHP. What the hell uses PHP on mac out of the box<|eor|><|sor|>Not even the person that complains apparently.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | AyrA_ch | gpiikw7 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|soopr|>Windows doesn't even come with the dotnet sdk integrated<|eoopr|><|sor|>Probably because most Windows users only need the runtime.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | Fitzsimmons | gpj5xrw | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>People do development against the system version of a programming language? There's no way that environment can match what's running in production. <|eor|><|eols|><|endoftext|> | 12 |
lolphp | captainramen | gpj7hkk | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>People do development against the system version of a programming language? There's no way that environment can match what's running in production. <|eor|><|soopr|>unless their laptop is the production environment<|eoopr|><|eols|><|endoftext|> | 12 |
lolphp | djxfade | gpkezj7 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|sor|>Yeah wtf, linux doesn't even come with PHP. What the hell uses PHP on mac out of the box<|eor|><|sor|>Its because Mac OS used to have an out of box Apache + PHP integration that you could enable with the click of button. It added a web folder for each user that could be used to host personal websites. That feature has long since been removed, but both Apache and PHP is still there for legacy support. Mac OS also comes with Perl and Python out of the box<|eor|><|eols|><|endoftext|> | 12 |
lolphp | ZiggyTheHamster | gpiipv1 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>But the meaning is that the OS included PHP isn't recommended, so what's the problem? Relying on a built in whatever-version of PHP is stupid to begin with.<|eor|><|sor|>I get that it can be read that way. But the words are: "PHP is not recommended". Not "This version of PHP is not recommended", not "Using the system version of PHP is not recommended", just "PHP is not recommended". It probably wasn't meant to say that PHP is not recommended in general, but that's what it actually says.<|eor|><|sor|>I think "PHP is not recommended" is a completely fair assessment. As a first language, there are way too many traps for newbies. And nobody bothers to go through comments on the docs and remove/clarify/update recommendations/samples which are no longer applicable or are no longer best practice, so what do newbies do? They copy the samples from the docs. Which are user submitted. 8 years ago. I wouldn't recommend that either.<|eor|><|eols|><|endoftext|> | 11 |
lolphp | mort96 | gpirfrt | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>The actual linked tweet is ok. It's not complaining that the OS PHP deprecated, but that Apple seems to be saying that PHP _in general_ is not recommended.
The rest of the thread is kinda weird though, I agree. Most languages aren't shipped with macOS after all.<|eor|><|sor|>But the meaning is that the OS included PHP isn't recommended, so what's the problem? Relying on a built in whatever-version of PHP is stupid to begin with.<|eor|><|sor|>I get that it can be read that way. But the words are: "PHP is not recommended". Not "This version of PHP is not recommended", not "Using the system version of PHP is not recommended", just "PHP is not recommended". It probably wasn't meant to say that PHP is not recommended in general, but that's what it actually says.<|eor|><|sor|>I think "PHP is not recommended" is a completely fair assessment. As a first language, there are way too many traps for newbies. And nobody bothers to go through comments on the docs and remove/clarify/update recommendations/samples which are no longer applicable or are no longer best practice, so what do newbies do? They copy the samples from the docs. Which are user submitted. 8 years ago. I wouldn't recommend that either.<|eor|><|sor|>That's a fair opinion to have. That doesn't mean it's appropriate for Apple to express that opinion in the command line of all their computers. I also don't think it's Apple's intention to communicate such an opinion, I think it's just unfortunate wording, so it's kind of moot anyways.<|eor|><|eols|><|endoftext|> | 9 |
lolphp | treerabbit23 | gpgit74 | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>*Me on Windows*
Your OS comes with PHP integrated?<|eor|><|sor|>Lol, yes but dont try to use Python.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | ryancerium | gphw33l | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>And its not just cause he's using php 7.3 which will be EOL in the not too distant future?<|eor|><|sor|>The tweet author is a woman.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | EmperorArthur | gpidc3n | <|sols|><|sot|>PHP 'Engineers' Using MacOS Lose Their Shit Because They Might Have to brew install PHP<|eot|><|sol|>https://twitter.com/snipeyhead/status/1366834425963696130<|eol|><|sor|>I've never used the builtin PHP. lrn2docker, noob.<|eor|><|sor|>Seriously. Rebuilding your infra on osx is a waste of time. I do all my dev in VMs or containers. Run all the same packages on my laptop that we use in production.
I started out doing php dev natively on osx, but it after the 12th time I had to fight with some issue specific to the osx environment that wasn't a problem in production I gave up<|eor|><|sor|>Fair warning. Osx is case insensitive by default, and Docker volume mounts will reflect that. There's nothing like it working on your machine, but then not working on the Linux server because composed can't find a file. That was fun to debug.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | msiemens | 2omtz9 | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|eols|><|endoftext|> | 82 |
lolphp | DCoder1337 | cmom67u | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>> *`var_export()` detect cycles in data structures (by crashing)*
That's genius.<|eor|><|eols|><|endoftext|> | 63 |
lolphp | maxufimo | cmonugg | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Ah, Evan Priestley of the [Phabricator](http://phabricator.org/) fame, gotta love this guy.
> Written in PHP so literally anyone can contribute, even if they have no idea how to program.
>
> Even babies and dogs can contribute.<|eor|><|eols|><|endoftext|> | 40 |
lolphp | satan-repents | cmosh2n | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Are we thinking of specific named functions, or overall functionality?
Because the most useful, commonly used function of PHP, is to provide convenient remote shell access to visitors of websites.<|eor|><|eols|><|endoftext|> | 29 |
lolphp | Jew_Fucker_69 | cmorwye | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Wow, I thought Forbes was better than to use full-page ads.<|eor|><|sor|>So you haven't been to forbes.com in several years?<|eor|><|eols|><|endoftext|> | 29 |
lolphp | shvelo | cmomd1b | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>die() is the most useful PHP function<|eor|><|eols|><|endoftext|> | 25 |
lolphp | mayupvoterandomly | cmosjdg | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|> phpinfo();
is actually very useful, especially if you're trying to match dev environments between servers and you only have the option of seeing a list on screen, vs. having something like cPanel package up your site.
I know, we're making fun of PHP...but phpinfo is actually one of the most useful thing the language offers.<|eor|><|sor|>Also extremely useful for gathering information on your target post-exploitation :P<|eor|><|eols|><|endoftext|> | 21 |
lolphp | more_exercise | cmrkdyb | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>die() is the most useful PHP function<|eor|><|sor|>I use exit();<|eor|><|sor|>But die(); looks a lot cooler!! <|eor|><|sor|>It really shows that you're an old perl hacker, not some snooty kid who came from a language that would rather use `exit`.<|eor|><|sor|>I really love how dramatic some perl error handling can be:
open(FILE, '<', 'myfile') or die;
It's so dramatic!<|eor|><|eols|><|endoftext|> | 21 |
lolphp | OneWingedShark | cmpsyyt | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Ah, Evan Priestley of the [Phabricator](http://phabricator.org/) fame, gotta love this guy.
> Written in PHP so literally anyone can contribute, even if they have no idea how to program.
>
> Even babies and dogs can contribute.<|eor|><|sor|>Look, that was kinda the point of PHP. It started as just a framework extension to Perl. It's just... they had a shitty dev team, and insist on keeping it that way. it's all about in-group clique narcissism. But the reason it was developed in the first place is a good reason, and now it's an ingrain legacy system - you pretty much have to use it.<|eor|><|sor|>I wouldn't defend PHP on here, it's a death sentence.<|eor|><|sor|>Which just shows you how stupid the people here are. The fact that they are just cultish groupthinkers is evidence that they really don't know shit about the intricacies of software and systems development.
And I'm one of the first ones to say that the PHP development team - "team" - fuck up constantly and refuse to admit it.
The point remains that PHP has utility in many situations.<|eor|><|sor|>> The point remains that PHP has utility in many situations.
My problem w/ PHP is that this utility [essentially "*quick and dirty*"] quickly dissolves into nothingness; when you get past a certain point everything that makes it attractive "*out of the box*" works against you. (e.g. the weak-typing means that you have to inspect the body of each function when tracing out a bug; the stronger the type-system, the more quickly [and locally] bad-data can be found and dealt with.)<|eor|><|eols|><|endoftext|> | 15 |
lolphp | simon99ctg | cmqmxr6 | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>gzgetss() - programming heuristic no. 232: never trust a function you're not sure how to pronounce<|eor|><|eols|><|endoftext|> | 12 |
lolphp | thelordofcheese | cmos6fq | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Wow, I thought Forbes was better than to use full-page ads.<|eor|><|sor|>I thought people on a programming forum were better than to see obtrusive ads.<|eor|><|eols|><|endoftext|> | 11 |
lolphp | papers_ | cmoqsg3 | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>die() is the most useful PHP function<|eor|><|sor|>I use exit();<|eor|><|sor|>But die(); looks a lot cooler!! <|eor|><|eols|><|endoftext|> | 11 |
lolphp | jonnywoh | cmovhbs | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Ah, Evan Priestley of the [Phabricator](http://phabricator.org/) fame, gotta love this guy.
> Written in PHP so literally anyone can contribute, even if they have no idea how to program.
>
> Even babies and dogs can contribute.<|eor|><|sor|>Even after all that, I still didn't expect what was at the bottom of the page.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | OneWingedShark | cmpt71x | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Ah, Evan Priestley of the [Phabricator](http://phabricator.org/) fame, gotta love this guy.
> Written in PHP so literally anyone can contribute, even if they have no idea how to program.
>
> Even babies and dogs can contribute.<|eor|><|sor|>Look, that was kinda the point of PHP. It started as just a framework extension to Perl. It's just... they had a shitty dev team, and insist on keeping it that way. it's all about in-group clique narcissism. But the reason it was developed in the first place is a good reason, and now it's an ingrain legacy system - you pretty much have to use it.<|eor|><|sor|>I wouldn't defend PHP on here, it's a death sentence.<|eor|><|sor|>Which just shows you how stupid the people here are. The fact that they are just cultish groupthinkers is evidence that they really don't know shit about the intricacies of software and systems development.
And I'm one of the first ones to say that the PHP development team - "team" - fuck up constantly and refuse to admit it.
The point remains that PHP has utility in many situations.<|eor|><|sor|>> The point remains that PHP has utility in many situations.
Exactly. It's down to knowing when and where to use it, and importantly, *how* to use it.<|eor|><|sor|>Exactly. And the answer isn't "rarely", because in a more wired world more people with less resources, less expertise, less time can just use a MVC CMS framework with tons of plug-in modules to share information for their small organization.
Um... there are better solutions after that.
Though, "free" may be a draw to many.<|eor|><|sor|>> Exactly. And the answer isn't "rarely", because in a more wired world more people with less resources, less expertise, less time can just use a MVC CMS framework with tons of plug-in modules to share information for their small organization.
Actually, I'd argue that the answer really is rarely.
When your organization is concerned about data integrity, handling monies, and/or dealing with security in the module/utility/program in question PHP is the wrong tool. -- And far too often the "*quick and dirty*" temporary fix is permanent, which is why a PHP solution should be *very* carefully considered.
(The incentive of free that you mention should be a non-issue; even Ada [which has a bit of a reputation as expensive from its DoD-mandate days] has a free compiler and a free webserver+template system.)<|eor|><|eols|><|endoftext|> | 10 |
lolphp | jb2386 | cmpiquy | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>die;
die();
<|eor|><|sor|>That's because it's a language construct, like echo or print etc.
You can use:
echo "My string";
echo("My string");<|eor|><|eols|><|endoftext|> | 8 |
lolphp | jb2386 | cmpinx5 | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Ah, Evan Priestley of the [Phabricator](http://phabricator.org/) fame, gotta love this guy.
> Written in PHP so literally anyone can contribute, even if they have no idea how to program.
>
> Even babies and dogs can contribute.<|eor|><|sor|>Look, that was kinda the point of PHP. It started as just a framework extension to Perl. It's just... they had a shitty dev team, and insist on keeping it that way. it's all about in-group clique narcissism. But the reason it was developed in the first place is a good reason, and now it's an ingrain legacy system - you pretty much have to use it.<|eor|><|sor|>I wouldn't defend PHP on here, it's a death sentence.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | OneWingedShark | cmrey38 | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>Look, that was kinda the point of PHP. It started as just a framework extension to Perl. It's just... they had a shitty dev team, and insist on keeping it that way. it's all about in-group clique narcissism. But the reason it was developed in the first place is a good reason, and now it's an ingrain legacy system - you pretty much have to use it.<|eor|><|sor|>I wouldn't defend PHP on here, it's a death sentence.<|eor|><|sor|>Which just shows you how stupid the people here are. The fact that they are just cultish groupthinkers is evidence that they really don't know shit about the intricacies of software and systems development.
And I'm one of the first ones to say that the PHP development team - "team" - fuck up constantly and refuse to admit it.
The point remains that PHP has utility in many situations.<|eor|><|sor|>> The point remains that PHP has utility in many situations.
Exactly. It's down to knowing when and where to use it, and importantly, *how* to use it.<|eor|><|sor|>Exactly. And the answer isn't "rarely", because in a more wired world more people with less resources, less expertise, less time can just use a MVC CMS framework with tons of plug-in modules to share information for their small organization.
Um... there are better solutions after that.
Though, "free" may be a draw to many.<|eor|><|sor|>> Exactly. And the answer isn't "rarely", because in a more wired world more people with less resources, less expertise, less time can just use a MVC CMS framework with tons of plug-in modules to share information for their small organization.
Actually, I'd argue that the answer really is rarely.
When your organization is concerned about data integrity, handling monies, and/or dealing with security in the module/utility/program in question PHP is the wrong tool. -- And far too often the "*quick and dirty*" temporary fix is permanent, which is why a PHP solution should be *very* carefully considered.
(The incentive of free that you mention should be a non-issue; even Ada [which has a bit of a reputation as expensive from its DoD-mandate days] has a free compiler and a free webserver+template system.)<|eor|><|sor|>A restaurant that just wants it menu online. A local band which has a list of gigs with directions to the venue.
There are plenty reasons why PHP with even a WordPress is a great solution.<|eor|><|sor|>> A restaurant that just wants it menu online. A local band which has a list of gigs with directions to the venue.
>
>
>
> There are plenty reasons why PHP with even a WordPress is a great solution.
Both of those avoid the qualifiers I mentioned in that they aren't dealing with money, security, or data-integrity. -- The problems start when the local restaurant or local band start selling things off their site.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | Jew_Fucker_69 | cmoo0yd | <|sols|><|sot|>What Are The Most Surprisingly Useful PHP Functions?<|eot|><|sol|>http://www.forbes.com/sites/quora/2012/08/31/what-are-the-most-surprisingly-useful-php-functions/<|eol|><|sor|>die() is the most useful PHP function<|eor|><|sor|>I use exit();<|eor|><|eols|><|endoftext|> | 7 |
lolphp | Porges | 24cdsd | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|eols|><|endoftext|> | 88 |
lolphp | suspiciously_calm | ch5w8wm | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|sor|>> Note that a function that calls a variable by reference CANNOT be used recursively, it will generate a CGI error
-___-
> Instead, you should just use global variables.
O______O<|eor|><|eols|><|endoftext|> | 41 |
lolphp | Porges | ch5ux67 | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|sor|>[deleted]<|eor|><|soopr|>In and of itself it isn't lol, but in PHP's case it serves as a nice index to the mini-gotchas<|eoopr|><|eols|><|endoftext|> | 40 |
lolphp | captainramen | ch5uchj | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|sor|>> Note: Note that<|eor|><|eols|><|endoftext|> | 16 |
lolphp | nikic | ch60w3i | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|sor|>> Note that a function that calls a variable by reference CANNOT be used recursively, it will generate a CGI error
-___-
> Instead, you should just use global variables.
O______O<|eor|><|sor|>Thanks for pointing this out. I've removed this absolutely wrong note and a few others. (Upstream, not synced.)<|eor|><|eols|><|endoftext|> | 14 |
lolphp | TortoiseWrath | ch9awqf | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|sor|>> Note that all values specifying length, distance, size, etc. are in "twips", twenty units per pixel. That's pretty much arbitrary, though, since the player scales the movie to whatever pixel size is specified in the embed/object tag, or the entire frame if not embedded.
wat<|eor|><|eols|><|endoftext|> | 13 |
lolphp | BilgeXA | chbdbr6 | <|sols|><|sot|>"Note that ..."<|eot|><|sol|>https://www.google.com/search?q="note+that"+site%3Awww.php.net%2Fmanual%2Fen<|eol|><|sor|>[deleted]<|eor|><|soopr|>In and of itself it isn't lol, but in PHP's case it serves as a nice index to the mini-gotchas<|eoopr|><|sor|>Not really since most of the real gotchas *aren't* documented.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | jamwaffles | 1i2pa1 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|eols|><|endoftext|> | 80 |
lolphp | InconsiderateBastard | cb0hm57 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>Null is amazing.
* NULL == 0
* NULL < -INF
* NULL == an empty array
* (NULL++) == 1
* (NULL--) == NULL
* (NULL -= 1) == -1
* (NULL - 1) == -1
<|eor|><|eols|><|endoftext|> | 30 |
lolphp | RealModeX86 | cb0ids7 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>Null is amazing.
* NULL == 0
* NULL < -INF
* NULL == an empty array
* (NULL++) == 1
* (NULL--) == NULL
* (NULL -= 1) == -1
* (NULL - 1) == -1
<|eor|><|sor|>So you can't decrement it but you can subtract 1 from it? Dafuq?<|eor|><|eols|><|endoftext|> | 28 |
lolphp | jamwaffles | cb0hlf6 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>As someone accustomed to php's quirks, I don't really see anything wrong here<|eor|><|soopr|>> As someone accustomed to php's quirks
There's your issue. Every language has it's quirks, but PHP takes a pretty unique stance on "quirks".<|eoopr|><|eols|><|endoftext|> | 21 |
lolphp | midir | cb0ix3s | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>As someone accustomed to php's quirks, I don't really see anything wrong here<|eor|><|soopr|>> As someone accustomed to php's quirks
There's your issue. Every language has it's quirks, but PHP takes a pretty unique stance on "quirks".<|eoopr|><|sor|>I've just realized your reddit account appears to have been [shadow banned](/r/ShadowBan) by the Reddit admins. Both this submission and your comment were in the spam bin. Unless someone fishes them out every time, no-one can see any of your posts. You could try contacting the Reddit admins for help but you might need to create a new account.<|eor|><|eols|><|endoftext|> | 17 |
lolphp | _vec_ | cb0iod7 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>Most of these kind of thing generally devolve to the foundational WTF that is PHP's implicit type coersion, but for the life of me I can't figure out how this behavior could be explained. I'm pretty sure this is something that a language developer had to do *on purpose*.<|eor|><|eols|><|endoftext|> | 16 |
lolphp | polish_niceguy | cb0rns4 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>[deleted]<|eor|><|sor|>Because PHP.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | Porges | cb13663 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>Most of these kind of thing generally devolve to the foundational WTF that is PHP's implicit type coersion, but for the life of me I can't figure out how this behavior could be explained. I'm pretty sure this is something that a language developer had to do *on purpose*.<|eor|><|sor|>From the answers it looks like someone simply forgot to put a case in the decrement operator for it.<|eor|><|eols|><|endoftext|> | 9 |
lolphp | davvblack | cb4h852 | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>Null is amazing.
* NULL == 0
* NULL < -INF
* NULL == an empty array
* (NULL++) == 1
* (NULL--) == NULL
* (NULL -= 1) == -1
* (NULL - 1) == -1
<|eor|><|sor|>So you can't decrement it but you can subtract 1 from it? Dafuq?<|eor|><|sor|>You can decrement arbitrary strings but can't subtract 1 from them.
<|eor|><|eols|><|endoftext|> | 9 |
lolphp | InconsiderateBastard | cb0hvpu | <|sols|><|sot|>NULL can't be decremented... but incrementing it is fine<|eot|><|sol|>http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559<|eol|><|sor|>take one out of the empty set, get the empty set
put one in the empty set, get one
<|eor|><|sor|>feasible but that's not what is implied, I'd say. Consider this:
$x = NULL; // empty set
$x--; // substract one, empty set
var_dump($x); // NULL
$x++; // add one, get one
var_dump($x); // int(1)
$x--; // substract one, empty set again?
var_dump($x); // int(0)
$x--; // following previous logic, should still be empty set
var_dump($x) // int(-1)<|eor|><|sor|>> // following previous logic, should still be empty set
If we had logic, maybe array sorting would be deterministic in PHP.<|eor|><|eols|><|endoftext|> | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.