chiprivers Posted May 29, 2012 Share Posted May 29, 2012 How do I create alternative contractor methods for my class. Like when you create a DateTime object you can create it using an alternative time passed by a string using DateTime::createFromFormat(). I want to have a default constructor method but a couple of extra contractor methods that can be called when the instance is created. Quote Link to comment https://forums.phpfreaks.com/topic/263332-classalternativecontructor/ Share on other sites More sharing options...
scootstah Posted May 29, 2012 Share Posted May 29, 2012 The methods would have to return an instance of the class. Quote Link to comment https://forums.phpfreaks.com/topic/263332-classalternativecontructor/#findComment-1349535 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.