Approved: Fortect
If you get an unexpected t_object_operator error, today’s tutorial is here to help you.
Not The Reaction You Are For? Study. Explore Non-PHP Questions Or Make Your Own Assumptions.
Unfortunately, until now in PHP 5.4 it is generally not possible to call a method that refers to an object, only with a new
created.
$ PurchaseOrder = (new PurchaseOrderFactory) -> instance ();
In previous updates, you had to call a method with a variable:
$ PurchaseFactory = new PurchaseOrderFactory;$ PurchaseOrder corresponds to $ PurchaseFactory-> instance ();
Received 11/14/12 at 10:36 PM
37.1k
Approved: Fortect
Fortect is the world's most popular and effective PC repair tool. It is trusted by millions of people to keep their systems running fast, smooth, and error-free. With its simple user interface and powerful scanning engine, Fortect quickly finds and fixes a broad range of Windows problems - from system instability and security issues to memory management and performance bottlenecks.
$ PurchaseOrder means PurchaseOrderFactory :: instance ();$ arrOrderDetails = $ PurchaseOrder-> load ($ customerName);
where instance ()
probably leads to an instance of the class. You have the opportunity toDo this instead of saying new
Retired November 14, 2012 10:34 PM
15.7k
new PurchaseOrderFactory-> instance ();
// Initializes a new PurchaseOrderFactory OU objectnew PurchaseOrderFactory ();// Clone an instance of the finally existing PurchaseOrderFactoryClone PurchaseOrderFactory :: instance ();// You just need to make sure to use an instancePurchaseOrderFactory :: instance ();// Initialize a new object and call one of its methods$ tmp = new PurchaseOrderFactory ();$ tmp-> instance ();
answered Nov 14, 2012 at 10:35 pm
19.3k
Speed up your computer's performance now with this simple download.