Question: I want to filter data from database between the start of current week to end of the week but I got empty result so I try to debug $startDate and $endDate than I got the same value form them.

Here is my code:

```
$currentDate = Carbon::now();
$startDate = $currentDate->startOfWeek();
$endDate = $currentDate->endOfWeek();

dd($startDate,$endDate);

```

Here is the result:

```
Carbon {#937 ▼
  +"date": "2017-08-13 23:59:59.000000"
  +"timezone_type": 3
  +"timezone": "Asia/Phnom_Penh"
}
Carbon {#937 ▼
  +"date": "2017-08-13 23:59:59.000000"
  +"timezone_type": 3
  +"timezone": "Asia/Phnom_Penh"
}

```

Why it show the same result, what wrong with my code?

Answer: 
Carbon passes all objects by reference, so each value you get returned references the same object and all future updates will change for all references.

You should use the [`copy`](https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Carbon.php#L635) function to make sure you get a new object.

```
$currentDate = Carbon::now();
$startDate = $currentDate->copy()->startOfWeek();
$endDate = $currentDate->copy()->endOfWeek();

```
You should try this :

```
$startDate = Carbon\Carbon::now()->startOfWeek()->format('Y/m/d');
$endDate = $date = Carbon\Carbon::now()->endOfWeek()->format('Y/m/d');

```

Hope this work for you !!!