Please help me understand:
print gettype(new CustomerObject())
prints: "object" (so it is an object)
BUT
print gettype((new CustomerObject())->get_customer());
prints: unexpected T_OBJECT_OPERATOR
If I do it over two lines it works fine
$object = new Customer($order->customer_id);
print gettype($object);
prints: object
$customer = $object->get_customer();
print gettype($customer);
prints: array
It appears that the lines cannot be joined into a single call. Is this correct? and what is the logic behind that?