You are not logged in.
Hi,
The subject is a Python idiom, that much I know . JavaScript offers a similar hack, too:
if(require.main === module) {
myMain();
}
Is there something like that for PHP? Examples of PHPUnit I've seen so far are conveniently restricted to testing classes. What is the right way with one file scripts in PHP? It's a fair scripting question, I presume.
Last edited by Llama (2016-01-15 15:19:04)
Offline
Can this help?
https://stackoverflow.com/questions/241 … -name-main
Offline
Thanks!
Looks like the real thing. Will take some time to grok, though .
Offline