+ 1

Which stye is better in writing method

Which stye is better in writing method Login (userid, time, useragent) { Insertintodb(userid,time, useragent); } OR Login(userid) { time = time.getTime() Useragent = http.getUseragen(); Insertintodb(userid,time, useragent); }

30th Mar 2020, 2:21 PM
Peace Imion
Peace Imion - avatar
6 ответов
+ 1
Ore Adeleye , I can't pass object as default value for params in PHP
30th Mar 2020, 5:15 PM
Peace Imion
Peace Imion - avatar
0
Better still Login(userid, time = time.getTime(), user_agent = http.getUserAgent()){ Insertintodb(userid, time, user_agent); }
30th Mar 2020, 2:26 PM
Ore
Ore - avatar
0
Mirielle(20k XP Monthly till November [2020]) should I go for the one with 1 or 3 parameters
30th Mar 2020, 5:13 PM
Peace Imion
Peace Imion - avatar
30th Mar 2020, 7:45 PM
Ore
Ore - avatar
30th Mar 2020, 7:46 PM
Ore
Ore - avatar