php - Call or Instantiate? -



php - Call or Instantiate? -

i building website in php i'll have create user, case & task classes, each of going have couple of methods. in index.php i'll need crud operation i've wrote in classes. improve phone call method , send parameters case::update(2) or improve instantiate class first phone call method like

$case = new case(); $case->update(2);

well, kingcrunch mentioned in comments, totally depends on whole architecture. furthermore, depends on preferences. if read through next links may have improve overview , can take yourself:

singleton pattern php patterns static versus non static in php the singleton design pattern php static phone call versus singleton phone call in php why singletons have no utilize in php difference between static class , singleton pattern

php class methods

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -