
114 Cal.App.3d 60 (1980)
170 Cal. Rptr. 440
THE PEOPLE, Plaintiff and Appellant,
v.
SERAFIN DOMINGUEZ IBARRA, Defendant and Appellant.
Docket No. 37569.
Court of Appeals of California, Second District, Division Three.
December 29, 1980.
*62 COUNSEL
John K. Van de Kamp, District Attorney, Harry B. Sondheim, Maurice H. Oppenheim and Richard W. Gerry, Deputy District Attorneys, for Plaintiff and Appellant.
Cynthia K. Cohan, under appointment by the Court of Appeal, for Defendant and Appellant.
OPINION
COBEY, Acting P.J.
Both parties appeal from a judgment based on a negotiated guilty plea. Defendant, Serafin Dominguez Ibarra, was charged by information with possession of heroin for sale. (Former Health & Saf. Code, § 11351, subd. (a).) It was also alleged that defendant possessed for sale one-half ounce or more of heroin, within the *63 meaning of Penal Code section 1203.07, subdivision (a)(1).[1] The trial court denied defendant's motions to set aside the information pursuant to section 995, to dismiss pursuant to section 1385 and to suppress evidence pursuant to section 1538.5. Defendant entered a negotiated plea of guilty to possession of heroin for sale and admitted that he possessed more than one-half ounce of a substance containing heroin. The trial court struck the section 1203.07 allegation, sentenced defendant to the upper term of four years (Health & Saf. Code, § 11351), suspended the execution of sentence and placed defendant on five years probation.
The People appeal, pursuant to section 1238, subdivisions (a)(5) and (a)(6), from the order placing defendant on probation. The People contend that the trial court lacked the power to strike the section 1203.07, subdivision (a)(1), allegation in order to render defendant eligible for probation.
Defendant appeals pursuant to sections 1237, subdivision 1, and 1538.5, subdivision (m). He contends that his motions to suppress evidence were wrongfully denied by the trial court because he did not voluntarily consent to the search of the car he was driving. He further contends that the heroin seized from the automobile and his subsequent admissions to police officers were inadmissible because of inadequate constitutional safeguards.
After reviewing the record and applicable authority we conclude that the trial court properly denied defendant's suppression motions, but lacked the authority to strike the section 1203.07, subdivision (a)(1), allegation.
We note that the challenged rulings were made by two different judges, namely, the Honorable Warren D. Allen and the Honorable William A. Munnell, and that the ruling which we conclude was erroneous was made by Judge Munnell.

FACTS
Defendant was stopped by several undercover narcotics officers who believed he was dealing in drugs. A cursory search of defendant and the automobile which he was driving did not lead to discovery of any drugs, but did turn up drug paraphernalia. Officer Del Rosario told defendant that he was free to go, but asked if defendant would be interested in *64 making a drug purchase under police supervision, for which he would be paid. Defendant agreed. Defendant and the officers drove to another location to finalize their plans for the drug purchase. At least twice officer Del Rosario explained that the purchase would be preceded by searches of defendant's body and automobile. Defendant agreed to submit to both searches. Defendant then went to a phone booth and, after calling, advised the officers he could not reach his supplier. Then officer Del Rosario suggested to defendant that they go ahead with the departmentally required body and automobile searches for the sake of expediency. Officer Pedrosa took defendant aside for the body search while officer Del Rosario searched the car which defendant was driving and found four packets of heroin on the drive shaft hump under the seat.

DISCUSSION

1. The trial court properly denied defendant's suppression motions.

(1a) Defendant contests the denial of his motions made pursuant to sections 995 and 1538.5.[2]
Defendant challenges the validity of the warrantless search of the automobile he was driving.[3] He contends that his purported consent was actually a submission to police authority. (2) The burden is on the people to establish the legality of a warrantless search, and when they rely on the consent exception to the warrant requirement, they must establish not only that the defendant consented, but that his consent was voluntarily given. Whether a consent was in fact voluntarily given is a factual determination which must be upheld on appeal if supported by substantial evidence. (See People v. Superior Court (Keithley) (1975) 13 Cal.3d 406, 410 [118 Cal. Rptr. 617, 530 P.2d 585].) (1b) The finding of the voluntariness of defendant's consent here is supported by the testimony of Officer Del Rosario that he discussed the search requirement several times with defendant, and that defendant agreed.
*65 Defendant argues, though, that the testimony of Officer Del Rosario does not constitute substantial evidence to support the implied finding of voluntariness because that testimony was undermined by additional facts shown in the record. In this connection defendant points to the facts that he was not reunited with his female companion and that he was not told that they were both free to go. But custody does not necessarily vitiate consent. (See People v. James (1977) 19 Cal.3d 99, 107-110 [137 Cal. Rptr. 447, 561 P.2d 1135].) Defendant asserts that his lack of consent is shown by his pretending that he could not reach his supplier. Efforts to mislead the police, though, do not necessarily vitiate consent freely given. (Id. at p. 108.) Defendant claims coercion from the fact that he was surrounded by police cars when originally stopped. But again, police domination does not necessarily vitiate consent. (Id. at pp. 110-111.) Defendant claims evidence of coercion from the fact that he consented to the search when he knew that the car contained heroin. This point has never been dispositive of the issue of consent. (Id. at pp. 113-114.) All of these facts are relevant circumstances in determining the voluntariness of a consent, but under all the circumstances here present, they neither singly nor in combination compel a conclusion of coercion as a matter of law. (Id. at pp. 107-114, and cases cited therein.)
(3) Defendant also claims that the automobile search was unconstitutional because he had not been given a Miranda warning. (See Miranda v. Arizona (1966) 384 U.S. 436 [16 L.Ed.2d 694, 86 S.Ct. 1602, 10 A.L.R.3d 974].) This claim is without merit because it is established that advice as to Miranda rights is not a prerequisite to a voluntary consent to search. (See People v. Thomas (1970) 12 Cal. App.3d 1102, 1108-1112 [91 Cal. Rptr. 867].)

2. The trial court improperly struck the Penal Code section 1203.07 allegation.

(4) The People are correct in their contention that the trial court exceeded its power when it struck the section 1203.07 allegation. The mandatory language of section 1203.07[4] is identical to that of section 1203.06 considered in People v. Tanner (1979) 24 Cal.3d 514 [156 Cal. Rptr. 450, 596 P.2d 328]. Under the Tanner reasoning the trial *66 court had no discretion to strike the one-half ounce allegation in order to make defendant eligible for probation. (See People v. Cooper (1979) 95 Cal. App.3d 844, 854 [157 Cal. Rptr. 348].) Accordingly, the order granting probation will be reversed.[5] (See People v. Gonzales (1979) 96 Cal. App.3d 725, 727-728 [158 Cal. Rptr. 204].)
The record is unclear as to whether the striking of the section 1203.07, subdivision (a)(1), allegation was part of the plea bargain. Accordingly, we will direct that an evidentiary hearing of this issue be held below, preferably before the trial judge who accepted the plea. If the trial court concludes that the striking of this allegation was pursuant to the plea bargain the defendant shall then be entitled to withdraw his plea of guilty and such further proceedings may thereafter be had as may be appropriate. If, after such hearing, the trial court concludes otherwise, the defendant shall be resentenced according to law.
(5) The mandatory prison term prescribed by section 1203.07 and Health and Safety Code section 11351 of two, three or four years does not constitute cruel or unusual punishment. The punishment is not so disproportionate to the crime that it shocks the conscience and offends fundamental notions of human dignity (see In re Foss (1974) 10 Cal.3d 910, 919 [112 Cal. Rptr. 649, 519 P.2d 1073]) and statutory denial of the right to probation is not considered cruel or unusual punishment. (See Bosco v. Justice Court (1978) 77 Cal. App.3d 179, 188 [143 Cal. Rptr. 468]; People v. Solorzano (1978) 84 Cal. App.3d 413, 415-416 [148 Cal. Rptr. 696].)

DISPOSITION
The judgment of conviction is affirmed subject to being possibly set aside by the trial court as specified above. The order granting probation is reversed. The case is remanded for the proceedings already indicated.
Allport, J., and Potter, J., concurred.
NOTES
[1]  All section references are to the Penal Code unless otherwise indicated.
[2]  Appellate review of the denial of a section 995 motion, challenging the validity of a search or seizure, is authorized by section 1538.5, subdivision (m), after a guilty plea notwithstanding the requirements of section 1237.5. (See People v. Lilienthal (1978) 22 Cal.3d 891, 895-897 [150 Cal. Rptr. 910].) Appellate review of the denial of the section 1538.5 motion is likewise authorized by that subdivision. Although the denial of the section 995 motion is properly before this court, the contention is without merit because there was no invalid search or seizure as we explain.
[3]  Defendant does not contest the validity of the earlier search of the automobile, or of either search of his person.
[4]  Section 1203.07 states in pertinent part: "(a) Notwithstanding the provisions of Section 1203, probation shall not be granted to, nor shall the execution or imposition of sentence be suspended for, any of the following persons: (1) Any person who is convicted of violating Section 11351 of the Health and Safety Code by possessing for sale one-half ounce or more of a substance containing heroin."
[5]  Tanner was not returned for further sentencing because our Supreme Court determined that it would be unjust in light of the unique facts surrounding his case. (See People v. Tanner, supra, 24 Cal.3d at p. 521.) Such unusual circumstances are not present here.
