You see parts of the "Object" in object-oriented programming
$ts3 represents an object containing all the necessary information, as well as some methods (or functions) that allow you to receive data from the object. Some of these methods will do different things to the object itself in order to get the additional data needed for a particular method call.
Consider the following simple object:
- bike
- Color
- gears
- __construct function ($ color, $ gears)
this.color = $color; this.gears = $gears- update function ()
this.headlight = true; this.gears = 10;
Now, when you first create it, it has only two properties:
$myBike = new Bike('red',5); // $myBike.color = 'red'; // $myBike.gears = 5;
... but as soon as you update, the properties have changed, and new ones added.
$myBike->upgrade(); // $myBike.color = 'red'; // $myBike.gears = 10; // $myBike.headlight = true;
Objects usually pass references rather than copy data to save memory.
... but if you want to make sure that you get a copy that does not change (i.e. does not use data references for the $ts3 ), clone the variable.
$a = clone($ts3->clientList());
Be careful, this will effectively double the amount of memory and processor for this variable.
source share