10 karma · joined December 2, 2014
1. Why does it matter?
2. Your first example I would simply call an asynchronous loop.
3. Your second example could possibly be called single recursion.
4. Recursion should at least consist of a base case and a recursive case, each self-reference should bring the input value closer to the base case which would end the recursion.
(Your second example has a recursive case and falls out into an undefined base case).
5. An example of 4 would be a tree structure where the base case is a leaf and recursion cases are branches.
function walk (value) {
if (Array.isArray(value)) {
value.forEach(walk);
} else {
console.log(value);
}
}
walk([[[1, 2, 3, [4, 5, 6]]],[[7, [8, 9, 10], 11, [12]]],13,14]);
would output: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14Failed closures that lack proper scoping, while they have been improved the underlying problem remains.
Continuation on inconsistency is that functions are not first class even though the syntax is the same for closures:
function foo () { } <--- This is a function
$foo = function () { } <--- This is a closure
Inconsistency; Cannot access functions (closures) directly from arrays.
$list["something"] = function () { };
$list["something"]() <- fatal error
What is "truthy" and what is "falsy", not unique to PHP but that doesn't mean PHP should do it.
Assumptions such as how it interprets numbers in octal
Functions do not follow any specific naming standard, i.e. some array functions are prefixed by array_*, some are not.
Include and require scoping is messed up as anything that is not a variable is mashed into the global scope.
Lastly in my post but far from all issues with PHP; A crap-load of legacy because "we can never break anything"
When password resetting ask for email, hash and match it against you stored hash.
If matching generate new password and store it, send the generated password to the email input by the user. Though it would likely be preferable to send some form of password-reset-token instead of a password which allows them to change to a new password within X time.
This way you never store their email-address in a usable plain-text.
But if your question was more to alternate methods than email in any form, hmmm, nope, sorry, can't think of any right now that are less invasive on privacy with the same security benefits.
So, google apps and then some, Google+!