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";

```
Convert to float or int type before do (+). Try:

```
$income += (float)$total_fare;

```

If your data can't convert to float, it will be 0.

Another way with PHP [floatval](https://www.php.net/manual/en/function.floatval.php):

```
$income += floatval($total_fare);

```

More information and discussion in SO about [PHP String to Float](https://stackoverflow.com/questions/481466/php-string-to-float)