What is the use of private static member functions?

This function could easily have been made freestanding, since it doesn’t require an object of the class to operate within. Making a function a static member of a class rather than a free function gives two advantages:

  1. It gives the function access to private and protected members of any object of the class, if the object is static or is passed to the function;
  2. It associates the function with the class in a similar way to a namespace.

In this case it appears only the second point applies.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)