As I am updating my script, there is some issues appearing I don't know if because of new php version or it was there all along but I haven't noticed yet. Here is one generic example that got me a lot of troubles:
function doSomething(arg1, arg2="test", arg3="error") { ... }
// so I did run some tests...
doSomething("Hi"); arg1, arg2, arg3 will be "Hi", "test", "error"
doSomething("Hi", "again"); arg1, arg2, arg3 will be "Hi", "again", "error"
doSomething("Hi", NULL, "no error"); arg1, arg2, arg3 will be "Hi", NULL, "noerror"
doSomething("Hi", FALSE, "no error"); arg1, arg2, arg3 will be "Hi", FALSE, "noerror"
The default value is only passed if I leave the argument empty at all. But if I wish to leave arg2 empty to get the default? Is there some keyword for this or some workaround?