3 ms·
Some of the PHP stuff, as others have noted with Python, etc., is misleading or outdated. Backticks work: echo `ls`; Constants can be declared globally:
by georgefox 15y ago
Some of the PHP stuff, as others have noted with Python, etc., is misleading or outdated.
Backticks work:
echo `ls`;
Constants can be declared globally:
const PI = 3.14;
Anonymous functions can be declared without create_function:
$f = function($x) { return $x*$x; }
I'm sure there are more. That said, I love these sorts of side-by-side comparisons.
- treetrouble 15y agoThere is a lot of non-idiomatic Ruby as well
- k33l0r 15y agoAlso it doesn't tell you that 'and' and 'or' are not equal to && and || in Ruby. http://hyperpolyglot.org/scripting#logical-operators http://hyperpolyglot.org/scripting#logical-operators
- belial 15y agoI've been developing with PHP for 2 years now and I didn't ever notice that we can make anonymous functions with PHP like that!! From where did you get that man??!! :D