Question: If the default replication factor was changed from 3 to 1, then are we not losing the reliability of hdfs? How can a hadoop engineer retrieve the only copy of the block if it is crashed or deleted for some reason?

Answer: 
You are adding up string values cast them to float

```
$income = floatval(0);

foreach (json_decode($read_one_vehicle_response, true)["ticket"] as $ticket) {

    if (is_numeric($ticket{"total_fare"})) {
       $total_fare = floatval($ticket{"total_fare"});
    }
    else {
        $total_fare = 0.00;
    }
    $income += $total_fare;
}

echo "Total: $income";

```
You can do directly,

```
$income = 0;

foreach (json_decode($read_one_vehicle_response, true)["ticket"] as $ticket) {
    $total_fare = (float) $ticket{"total_fare"};

    $income += $total_fare;
}

echo "Total: $income";

```