Hacker News new | past | comments | ask | show | jobs | submit login
PHP Cheat Sheet (encycode.com)
16 points by edw519 on Aug 27, 2009 | hide | past | favorite | 8 comments



"PHP doesn't support global varibles..."

Since when?


Nice catch. As explained at www.php.net/global, PHP most certainly does "support global variables". They are accessible by declaring them with the "global" keyword within the scope they are to be used, or by accessing them via the $GLOBALS superglobal (one that, it appears, the author neglected to include in his list of superglobals)


Is `=&` actually an operator, or is it simply:

$foo = &$bar;

"set $foo to the address of $bar", like you'd expect from C?


The proper way is $foo = &$bar, but for some reason $foo =& $bar seems to be frequently used to achieve the same thing.


when i look at that cheat sheet, i understand why php has such a bad fame: if you need to look up those function, you can't create good code!

still, a real php cheat sheet may be helpful to navigate through php's idiotic functions naming scheme...


No mention of lambda style anonymous functions, too!


Omits foreach; regretful.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: