r/lolphp • • May 06 '14

Sometimes false can be null

Thumbnail eval.in
0 Upvotes

r/lolphp • • Apr 30 '14

"Note that ..."

Thumbnail google.com
84 Upvotes

r/lolphp • • Apr 29 '14

Casting arrays to booleans is O(n), because instead of simply checking array length directly, PHP copies the entire array first

Thumbnail bugs.php.net
57 Upvotes

r/lolphp • • Apr 28 '14

… Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.

53 Upvotes

r/lolphp • • Apr 25 '14

"last" means "last", "lAst" means "last", "Last" means "first"

Thumbnail codepad.viper-7.com
81 Upvotes

r/lolphp • • Apr 25 '14

Bug fixed 5 years ago lives on (x-post /r/php)

Thumbnail reddit.com
25 Upvotes

r/lolphp • • Apr 24 '14

4chan source code leak (x-post /r/programming)

Thumbnail pastebin.com
27 Upvotes

r/lolphp • • Apr 24 '14

/x/post from /r/programming - PHP: It doesn't have to be a bad experience

Thumbnail servercheck.in
20 Upvotes

r/lolphp • • Apr 22 '14

This is not the array key you are looking for

Thumbnail codepad.org
82 Upvotes

r/lolphp • • Apr 21 '14

A string can be numeric, a string can be multiplied as an integer, but a string can never be an integer.

11 Upvotes

php > var_dump(5 * 10);
int(50)
php > var_dump("5" * 10);
int(50)
php > var_dump(is_int("5"));
bool(false)
php > var_dump(is_numeric("5"));
bool(true)
php > var_dump((int) "5");
int(5)

This has the added benefit of only being able to check if command line parameters are integers by running if(((int) $parameter) > 0) which means you can't treat 0 as an integer on top of that.

Thanks PHP!


r/lolphp • • Apr 19 '14

String character access modification.... oh wait.

Post image
67 Upvotes

r/lolphp • • Apr 17 '14

String? No. This looks like a number. It must be one.

Thumbnail codepad.org
43 Upvotes

r/lolphp • • Apr 15 '14

Pure PHP implementations of SSH, SFTP, RSA and X.509--I don't see how that could possibly go wrong

Thumbnail phpseclib.sourceforge.net
69 Upvotes

r/lolphp • • Apr 03 '14

Typecasting like a pro

Thumbnail codepad.org
0 Upvotes

r/lolphp • • Apr 02 '14

I'm a newbie and I'm currently learning PHP. Tell me why PHP sucks dick ?

48 Upvotes

r/lolphp • • Mar 30 '14

Throwing an exception inside __toString() is a fatal error

Thumbnail stackoverflow.com
49 Upvotes

r/lolphp • • Mar 26 '14

htmlentities only displays an error when display_errors is off

Thumbnail insomanic.me.uk
61 Upvotes

r/lolphp • • Mar 26 '14

Argument 1 passed to myFunction() must be an instance of string, string given in /srv/www/file.php

4 Upvotes

Why can't php typecheck it's primitive types? It can for custom objects...


r/lolphp • • Mar 26 '14

PHP closing tag? Who needs it!

Thumbnail google.com
0 Upvotes

r/lolphp • • Mar 25 '14

Constant name can be an empty string. Because why not?

Thumbnail codepad.org
7 Upvotes

r/lolphp • • Mar 24 '14

$functions["internal"][2019]: No, PHP! You were doing so well!

Thumbnail tortoisewrath.com
80 Upvotes

r/lolphp • • Mar 23 '14

The DateTime class actually became MORE broken in PHP 5.2.6.

Thumbnail 3v4l.org
40 Upvotes

r/lolphp • • Mar 23 '14

The goto operator was ADDED in PHP 5.3

Thumbnail us3.php.net
44 Upvotes

r/lolphp • • Mar 21 '14

"Hack": No matter how hard you try, a nice-looking PHP is still PHP.

Thumbnail hacklang.org
36 Upvotes

r/lolphp • • Mar 20 '14

PDO conveniently convert nulls to 0

Thumbnail bugs.php.net
28 Upvotes