So... i saw this in some of my colleagues code
foreach( myfunction() as $value) { //use $value to do something }
i, i... don;t do this and i find it WROONG in the long run, because i had a bad experience once when the server had a older version php and all my work simply stoped working. back then i used functions as parameters in other functions.
i find it wrong because if you code the project like this, on your local machine, were you have a wamp/xamp/easyphp/whatever and then you move to the server your work, then you could find yourself looking like a fool to your collegues, clients because you wouold have to : debug it to find out why a perfecly working project simply broke when you put it on the server and then you have to lose time talking to the server guys and then apologising to the client.
**My question is: Should you do this or should you go the normal, beginner way and declare a variable and then use it in the constructs ?
What do you guys think?**
No responses yet.