Brandon_R Posted November 6, 2009 Share Posted November 6, 2009 Hello guys, im now getting to know OOP and would like to know which is more efficient and faster. Normal OOP ($class->function) or Paamayim Nekudotayim (CLASS::function) Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/180501-which-is-more-efficient/ Share on other sites More sharing options...
ToonMariner Posted November 6, 2009 Share Posted November 6, 2009 I don't think there is a difference in tems of efficiency - this is more to do with scope of methods/members Quote Link to comment https://forums.phpfreaks.com/topic/180501-which-is-more-efficient/#findComment-952236 Share on other sites More sharing options...
Alex Posted November 6, 2009 Share Posted November 6, 2009 You can only do the latter if you're trying to access a static method, meaning that you can't just do $instance::method();. So the circumstances in which either would be used are totally different. Assuming that static methods are properly named so the speed of execution will be about the same, if they're not properly marked the execution time will be ~double (Note: This is referring to just calling a function, not taking any additional processing into account). Quote Link to comment https://forums.phpfreaks.com/topic/180501-which-is-more-efficient/#findComment-952241 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.