I am trying to solve the question SETGID bit gets reset for newly created directories inside sites/default/files. Please Note the Update-2 there.
I want to know which method creates the directories like php, css and js inside the
web/sites/default/files directory. I think the method or function which creates css and js abuse the
chmod function because only PHP directories obeys the setgid (set group ID) bit rule.