0, // 'max' => 45.92, // 'electric' => 0, // 'mileage' => 0 // ], // [ // 'min' => 45.92, // 'max' => 44, // 'electric' => 10, // 'mileage' => 5 // ], // [ // 'min' => 46.65, // 'max' => 47.11, // 'electric' => 20, // 'mileage' => 10 // ], // [ // 'min' => 47.11, // 'max' => 47.38, // 'electric' => 30, // 'mileage' => 15 // ], // [ // 'min' => 47.38, // 'max' => 47.59, // 'electric' => 40, // 'mileage' => 20 // ], // [ // 'min' => 47.59, // 'max' => 47.76, // 'electric' => 50, // 'mileage' => 25 // ], // [ // 'min' => 47.76, // 'max' => 47.9, // 'electric' => 60, // 'mileage' => 30 // ], // [ // 'min' => 47.9, // 'max' => 48.12, // 'electric' => 70, // 'mileage' => 35 // ], // [ // 'min' => 48, // 'max' => 48.12, // 'electric' => 80, // 'mileage' => 40 // ], // [ // 'min' => 48.12, // 'max' => 48.29, // 'electric' => 90, // 'mileage' => 45 // ], // [ // 'min' => 48.29, // 'max' => false, // 'electric' => 100, // 'mileage' => 50 // ], [ 'min' => 0, 'max' => 43, 'electric' => 0, 'mileage' => 0 ], [ 'min' => 43, 'max' => 44, 'electric' => 10, 'mileage' => 5 ], [ 'min' => 44, 'max' => 46, 'electric' => 20, 'mileage' => 10 ], [ 'min' => 46, 'max' => 47, 'electric' => 30, 'mileage' => 15 ], [ 'min' => 47, 'max' => 48, 'electric' => 40, 'mileage' => 20 ], [ 'min' => 48, 'max' => 49, 'electric' => 50, 'mileage' => 25 ], [ 'min' => 49, 'max' => 50, 'electric' => 60, 'mileage' => 30 ], [ 'min' => 50, 'max' => 51, 'electric' => 70, 'mileage' => 35 ], [ 'min' => 51, 'max' => 52, 'electric' => 80, 'mileage' => 40 ], [ 'min' => 52, 'max' => 53, 'electric' => 90, 'mileage' => 45 ], [ 'min' => 53, 'max' => false, 'electric' => 100, 'mileage' => 50 ], ]; public function byVoltageGetElectric($v) { foreach (self::fangans as $fangan) { if ($fangan['min'] === false && $fangan['max'] > $v) { return $fangan['electric']; } if ($fangan['max'] === false && $v['max'] <= $v) { return $fangan['electric']; } if ($fangan['min'] <= $v && $fangan['max'] > $v) { return $fangan['electric']; } } } }