In PHP, how do I concatenate objects with Composer?

This example demonstrates how to concatenate properties from two objects using PHP with Composer.
PHP, Composer, Object-Oriented Programming, Concatenate Objects
<?php require 'vendor/autoload.php'; class User { public $firstName; public $lastName; public function __construct($firstName, $lastName) { $this->firstName = $firstName; $this->lastName = $lastName; } } $user1 = new User("John", "Doe"); $user2 = new User("Jane", "Smith"); // Concatenate first and last names from both objects $fullName1 = $user1->firstName . ' ' . $user1->lastName; $fullName2 = $user2->firstName . ' ' . $user2->lastName; echo "User 1: " . $fullName1 . "<br>"; echo "User 2: " . $fullName2 . "<br>"; ?>

PHP Composer Object-Oriented Programming Concatenate Objects