subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
lolphp | orbital1337 | dhyehfu | <|sols|><|sot|>Why is this allowed? (Inverse inheritance)<|eot|><|sol|>https://3v4l.org/qLedW<|eol|><|sor|>Why shouldn't it be? There are some situations where a parent class might want to call something in a child. The most common would be overridden methods. Would you prefer it if they were a special case?<|eor|><|so... | 6 |
lolphp | jesseschalken | dibsmvq | <|sols|><|sot|>Why is this allowed? (Inverse inheritance)<|eot|><|sol|>https://3v4l.org/qLedW<|eol|><|sor|>The reason for this is that if you have
abstract class A {
protected abstract protected function bar();
public function foo() {
echo $this->bar();
}
}
class B exten... | 5 |
lolphp | mtantawy | 5oiftm | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|eols|><|endoftext|> | 29 |
lolphp | stumpychubbins | dck6yz2 | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>"They'll work with the single-byte UTF-8 chars, but not the multi-byte ones."
Oh.<|eor|><|s... | 37 |
lolphp | Matt3k | dcjj5t4 | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>"They'll work with the single-byte UTF-8 chars, but not the multi-byte ones."
Oh.<|eor|><|e... | 36 |
lolphp | SituationSoap | dcjsfmp | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>> Switch to dollars or fix your LOCALE.
Come on guys, Rasmus solved this problem six years ... | 34 |
lolphp | the_alias_of_andrea | dcjoccn | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>Yes. Because they don't in C.
If you want to inspect UTF-8 characters, there's the `IntlCha... | 26 |
lolphp | emilvikstrom | dcjts06 | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>This is of course not documented anywhere. A shame too since the ctype functions used to be ... | 9 |
lolphp | mtantawy | dcjhsjy | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|soopr|>INB4 this link is from 2010, i still have similar problem now using php7.0 and 7.1 as well... | 9 |
lolphp | mtantawy | dcjsw61 | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>deleted ^^^^^^^^^^^^^^^^0.1907 [^^^What ^^^is ^^^this?](https://pastebin.com/FcrFs94k/3443... | 9 |
lolphp | mtantawy | dcjm1lo | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>"They'll work with the single-byte UTF-8 chars, but not the multi-byte ones."
Oh.<|eor|><|s... | 8 |
lolphp | ennorehling | dcjmbkb | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>It's 2017, and programmers still don't understand character encodings.<|eor|><|eols|><|endof... | 7 |
lolphp | jesseschalken | dcw7xf0 | <|sols|><|sot|>It's 2017 and "ctype" functions still can't handle UTF-8 characters<|eot|><|sol|>http://grokbase.com/t/php/php-i18n/102tkqe6rk/ctype-print-returns-false-for-british-pound-symbol-and-non-ascii-symbols<|eol|><|sor|>The "ctype" functions are wrappers for the C functions in [`ctype.h`](http://www.cplusplus.c... | 6 |
lolphp | pilif | 56y1sl | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|eols|><|endoftext|> | 32 |
lolphp | SirClueless | d8o1ync | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Because PHP's arrays are dual-purpose, there are usually two approaches to array manipulations. This isn't especially surprising.<|eor|><|sor|>For you.<|eor|><|sor|>No, it's un... | 22 |
lolphp | SnowdogU77 | d8nlym5 | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>This is a well known "feature" and (as usual) kindly mentioned in documentation<|eor|><|sor|>Ah yes, the classic PHP dilemma. In the words of our founding fathers, "Just becaus... | 20 |
lolphp | sloat | d8nqddx | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>This is a well known "feature" and (as usual) kindly mentioned in documentation<|eor|><|sor|>Correct. The documentation states: Numeric keys will be renumbered.
Numeric...
ht... | 18 |
lolphp | BilgeXA | d8nlrfb | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Because PHP's arrays are dual-purpose, there are usually two approaches to array manipulations. This isn't especially surprising.<|eor|><|sor|>For you.<|eor|><|eols|><|endoftex... | 18 |
lolphp | inopia | d8oct4b | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Because PHP's arrays are dual-purpose, there are usually two approaches to array manipulations. This isn't especially surprising.<|eor|><|sor|>For you.<|eor|><|sor|>Well, it wo... | 16 |
lolphp | nazar-pc | d8nbd7e | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>This is a well known "feature" and (as usual) kindly mentioned in documentation<|eor|><|eols|><|endoftext|> | 13 |
lolphp | bwoebi | d98cagb | <|sols|><|sot|>quick quiz without clicking. What evaluates array_merge([], [1234 => true]) to?<|eot|><|sol|>https://3v4l.org/fEd4b<|eol|><|sor|>Just for the record, `[] + [1234 => true]` will do what you expect.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | whatsaret | 2x84jn | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|eoss... | 32 |
lolphp | cfreak2399 | coxr9h8 | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 57 |
lolphp | nick_danger | coxsurv | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 24 |
lolphp | allthediamonds | coxqosq | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 23 |
lolphp | xiongchiamiov | coxxmh1 | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 20 |
lolphp | ioctl79 | coxu3pj | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 19 |
lolphp | madsohm | coxv7ii | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 18 |
lolphp | PasswordIsntHAMSTER | coxxy1k | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 18 |
lolphp | captainramen | coxulrw | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 16 |
lolphp | ZugNachPankow | coxqnow | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 14 |
lolphp | thallippoli | coxsqwg | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 12 |
lolphp | PasswordIsntHAMSTER | coxtsfl | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 12 |
lolphp | implicit_cast | coxy8ic | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 11 |
lolphp | _vec_ | coy7zlr | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 10 |
lolphp | allthediamonds | coy8mf6 | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 9 |
lolphp | cjwelborn | coxxfip | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 8 |
lolphp | allthediamonds | cp12uby | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 8 |
lolphp | allthediamonds | cp12sdt | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 8 |
lolphp | Banane9 | cozultq | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 7 |
lolphp | allthediamonds | coy8xin | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 7 |
lolphp | allthediamonds | coy95kc | <|soss|><|sot|>A question<|eot|><|sost|>Do you guys honestly _hate_ php? in my opinion it's quirky as hell but there's nothing that wrong with it, a lot of developers just don't understand what they're doing and fuck up their own code
EDIT: You guys have sold me, looking into python based web development<|eost|><|sor|... | 6 |
lolphp | dchestnykh | 1dc5kc | <|sols|><|sot|>"The algos Salsa10 and Salsa20 have been removed [from hash extension] because they are actually stream ciphers and not hash functions."<|eot|><|sol|>https://bugs.php.net/bug.php?id=60783<|eol|><|eols|><|endoftext|> | 31 |
lolphp | Altreus | z4ozf | <|soss|><|sot|>PDO throws exceptions that cannot be recreated.<|eot|><|sost|>PDOException extends Exception. Fact.
The code parameter to Exception's constructor is required to be an integer. It won't even try to coerce (even though this is supposed to be a coercive language) so you have to make sure it's an int.
getC... | 28 |
lolphp | ealf | mga98 | <|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0)
<|eot|><|sost|><|eost|><|eoss|><|endoftext|> | 30 |
lolphp | jsprogrammer | c3nlkcu | <|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0)
<|eot|><|sost|><|eost|><|sor|>It's not that bad. They're just changing anything <0 to -1, >0 to 1 and leaving 0 alone. They're apparently more interested in comparing equality rather than the standard >0, <0, 0.<|eor|><|sor|>Whence the _BOOL... | 15 |
lolphp | gwynjudd | c30oiug | <|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0)
<|eot|><|sost|><|eost|><|sor|>This is the PHP equivalent of the famous daily wtf entry with true, false and file not found.<|eor|><|eoss|><|endoftext|> | 10 |
lolphp | codefocus | c30pqat | <|soss|><|sot|>#define ZEND_NORMALIZE_BOOL(n) ((n) ? (((n)>0) ? 1 : -1) : 0)
<|eot|><|sost|><|eost|><|sor|>Is this different than true/false/undefined in javascript or true/false/null in SQL, etc?<|eor|><|sor|>Yeah this is truePositive, trueNegative and false.
...don't ask me why :S<|eor|><|eoss|><|endoftext|> | 9 |
lolphp | ealf | gb4sr | <|soss|><|sot|>The return value of uniqid() is the current time in milliseconds, as a hexadecimal string. How does PHP guarantee that the value is 'unique'?<|eot|><|sost|>Answer:
usleep(1);
Bonus awesome:
* Takes optional parameter more_entropy "which should make the results more unique" by appending rand()
... | 29 |
lolphp | philikon | c1qaix0 | <|soss|><|sot|>The return value of uniqid() is the current time in milliseconds, as a hexadecimal string. How does PHP guarantee that the value is 'unique'?<|eot|><|sost|>Answer:
usleep(1);
Bonus awesome:
* Takes optional parameter more_entropy "which should make the results more unique" by appending rand()
... | 7 |
lolphp | brinchj | c1nsxmn | <|soss|><|sot|>The return value of uniqid() is the current time in milliseconds, as a hexadecimal string. How does PHP guarantee that the value is 'unique'?<|eot|><|sost|>Answer:
usleep(1);
Bonus awesome:
* Takes optional parameter more_entropy "which should make the results more unique" by appending rand()
... | 5 |
lolphp | tee2chains | mq28hy | <|sols|><|sot|>A Theory About PHP<|eot|><|sol|>https://www.commitstrip.com/en/2021/02/03/a-theory-about-php/<|eol|><|eols|><|endoftext|> | 29 |
lolphp | coldoil | guefugs | <|sols|><|sot|>A Theory About PHP<|eot|><|sol|>https://www.commitstrip.com/en/2021/02/03/a-theory-about-php/<|eol|><|sor|>Eh, cute comic, but I'm going to disagree with the premise slightly. React at least has a coherent design philosophy, whether you agree with that philosophy or not. I think that's more than can be s... | 21 |
lolphp | sproingie | j7zgqi | <|sols|><|sot|>Caching makes everything faster. Right?<|eot|><|sol|>https://thephp.cc/news/2020/10/caching-makes-everything-faster-right<|eol|><|eols|><|endoftext|> | 28 |
lolphp | sproingie | g87u4c6 | <|sols|><|sot|>Caching makes everything faster. Right?<|eot|><|sol|>https://thephp.cc/news/2020/10/caching-makes-everything-faster-right<|eol|><|soopr|>The place from which the lol arises. The LOLularity if you will: https://bugs.php.net/bug.php?id=78285
... because a file doesn't exist if it does exist but isn't rea... | 13 |
lolphp | Jinxuan | elvcls | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 28 |
lolphp | AyrA_ch | fdktsh2 | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 33 |
lolphp | pilif | fdl69bi | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 13 |
lolphp | SaltineAmerican_1970 | fdkr78n | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 12 |
lolphp | Jinxuan | fdkrlt1 | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 9 |
lolphp | bart2019 | fdmlnjy | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 8 |
lolphp | AyrA_ch | fdn15x3 | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 7 |
lolphp | Altreus | fdkwzoq | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 6 |
lolphp | AyrA_ch | fdn4rob | <|soss|><|sot|>::class is defined from no where<|eot|><|sost|>It is known that if `A` is defined as a class, then `A::class` will give class name as string.
However, if A is not defined. We can still have `A::class`:
```
<?php
new A; // PHP Fatal error: Class 'A' not found
echo A::class; // It works, echoing A...
``... | 5 |
lolphp | ntzm_ | e97pvd | <|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|eols|><|endoftext|> | 27 |
lolphp | duskwuff | fahfebw | <|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`.
Protected attributes use internal key names like `\0*\0foo`.<|eor|><|eol... | 21 |
lolphp | Altreus | faioijq | <|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`.
Protected attributes use internal key names like `\0*\0foo`.<|eor|><|sor... | 14 |
lolphp | colshrapnel | fah0qy7 | <|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>This one is amazing. Especially the key() output.<|eor|><|eols|><|endoftext|> | 10 |
lolphp | duskwuff | faiq18r | <|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`.
Protected attributes use internal key names like `\0*\0foo`.<|eor|><|sor... | 7 |
lolphp | shaql | fajlmt5 | <|sols|><|sot|>Let's see what happens when you run iteration methods on an object<|eot|><|sol|>https://3v4l.org/JtStv<|eol|><|sor|>Extra crazy detail that isn't visible in the output: `key($f)` is actually returning `\0Foo\0bar` and `\0Foo\0xyz`.
Protected attributes use internal key names like `\0*\0foo`.<|eor|><|sor... | 5 |
lolphp | sproingie | cmt0yc | <|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|eols|><|endoftext|> | 28 |
lolphp | the_alias_of_andrea | ew4iqp7 | <|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|sor|>Because they're not nested functions like in Python, they are just global function definitions that are executed as statements. It does have its uses (polyfills!), but indeed, you must make sure you don't e... | 15 |
lolphp | bart2019 | ew4vthw | <|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|sor|>Because they're not nested functions like in Python, they are just global function definitions that are executed as statements. It does have its uses (polyfills!), but indeed, you must make sure you don't e... | 11 |
lolphp | jesseschalken | ew4hz1w | <|sols|><|sot|>Nested functions in PHP are redeclared every call<|eot|><|sol|>https://3v4l.org/anQls<|eol|><|sor|>They should really disallow function, class and constant definitions in function and method bodies IMO. It looks way too much like a local definition. <|eor|><|eols|><|endoftext|> | 10 |
lolphp | HannesHendrik | ch5c9r | <|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|eols|><|endoftext|> | 26 |
lolphp | thenickdude | eupyy0s | <|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|sor|>The instruction to call `unset()` sounds a little odd. To clear an array you're going to pass to a function you'd normally think to use `$arr = ... | 47 |
lolphp | dahakaDAHK | eupnonf | <|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|sor|>I'm not sure this qualifies as lolphp.
There is no question if the array is modified - the choice is append or overwrite. Emptying the array an... | 8 |
lolphp | vita10gy | eur3xab | <|sols|><|sot|>If you do not want a (by-reference) argument to be modified, call unset() on it before passing it <|eot|><|sol|>https://i.redd.it/00hbu9g1m7c31.png<|eol|><|sor|>I'm not sure this qualifies as lolphp.
There is no question if the array is modified - the choice is append or overwrite. Emptying the array an... | 6 |
lolphp | n0t0ri0us9 | 55sogy | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|eols|><|endoftext|> | 29 |
lolphp | galaktos | d8dcq0h | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov ... | 19 |
lolphp | galaktos | d8ddong | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov ... | 15 |
lolphp | galaktos | d8dn9eb | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov ... | 12 |
lolphp | jesseschalken | d8egi3o | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>I'm not sure what's particularly wrong with invariant type declarations. They're inconvenient, perhaps, but PHP is not restric... | 7 |
lolphp | the_alias_of_andrea | d8dmsf3 | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>I'm not sure what's particularly wrong with invariant type declarations. They're inconvenient, perhaps, but PHP is not restric... | 6 |
lolphp | the_alias_of_andrea | d8dndy9 | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov ... | 6 |
lolphp | the_alias_of_andrea | d8dmnqj | <|sols|><|sot|>"You say Php5 had OOP and even Php7 cannot do this?" "Yea, too hard!"<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/55n15e/question_about_return_types_in_php_7/<|eol|><|sor|>Top comment states that ideally, contravariant return type refinement would be supported, in blatant disregard of the [Liskov ... | 5 |
lolphp | pgl | 2vrgr6 | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 27 |
lolphp | ladaghini | cok9wi8 | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 21 |
lolphp | pgl | cokadhk | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 18 |
lolphp | allthediamonds | cokx0c8 | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 16 |
lolphp | pilif | col1vs3 | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 15 |
lolphp | DoctorWaluigiTime | cokt9zb | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 12 |
lolphp | implicit_cast | cokf3xr | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 11 |
lolphp | MeLoN_DO | coka5k6 | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 11 |
lolphp | pgl | cokacyz | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 9 |
lolphp | pgl | conzrnf | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 8 |
lolphp | poizan42 | colea1g | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 6 |
lolphp | FionaSarah | conzk8t | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 6 |
lolphp | Various_Pickles | cok8ynp | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 5 |
lolphp | pgl | cokm8aq | <|sols|><|sot|>irestful/MultipleHashMapQueueMessageRetrieverCriterias<|eot|><|sol|>https://github.com/irestful/MultipleHashMapQueueMessageRetrieverCriterias/blob/master/MultipleHashMapQueueMessageRetrieverCriterias/Domain/MultipleHashMapQueueMessageRetrieverCriterias/Adapters/Exceptions/CannotConvertMultipleHashMapQueu... | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.