
66 Cal.2d 257 (1967)
BRUCE HARRY MARTIN et al., Petitioners,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
L. A. No. 29078. 
Supreme Court of California. In Bank.  
Mar. 27, 1967.
 Erling J. Hovden, Public Defender, William V. Larsen and James L. McCormick, Deputy Public Defenders, and Mel La Valley for Petitioners.
 No appearance for Respondent. *258
 Thomas C. Lynch, Attorney General, William E. James, Assistant Attorney General, Evelle J. Younger, District Attorney, Harry Wood, Harry B. Sondheim and Robert J. Lord, Deputy District Attorneys, for Real Party in Interest.
 THE COURT.
 By information petitioners and Sam Mendola were jointly charged with possession of marijuana for sale in violation of Health and Safety Code section 11530.5.petitioners' motion to set the information aside on the ground that the evidence against them was obtained by an illegal search and seizure was denied, and they now seek prohibition to prevent their trial. (See Badillo v. Superior Court, 46 Cal.2d 269, 271 [294 P.2d 23].)
 The record of the preliminary hearing discloses that the only evidence to support the information was obtained by a search and seizure without a warrant at an apartment where Mendola lived when he and petitioners were arrested. The prosecution sought to establish probable cause to justify Mendola's arrest and the search and seizure incident thereto by the testimony of one of the arresting officers. The officer testified that he received information from two informers that Mendola was selling marijuana and had substantial quantities of it at his apartment. From past experience the officer regarded one of the informers as reliable and the other as unreliable. The officer refused to divulge the informers' identity, however, and petitioners therefore moved to strike his testimony and dismiss the proceedings on the ground that the prosecution had failed to establish that essential evidence was lawfully obtained. The magistrate denied their motion, and thereafter the superior court denied a motion made on the same ground to set the information aside. (Pen. Code,  995).
 [1] In 1958 in Priestly v. Superior Court, 50 Cal.2d 812, 819 [330 P.2d 39], we held that when communications from an informer are relied upon to show reasonable cause to make an arrest and a search and seizure incident thereto, the identity of the informer must be disclosed at the defendant's request or the testimony as to his communications must be struck. In 1965 the Legislature enacted Code of Civil Procedure section 1881.1  [fn. 1] to give the magistrate or trial judge in *259 narcotics prosecutions discretion to permit nondisclosure of the name or identity of an informer if he is satisfied after a hearing that the informer is reliable.
 The United States Supreme Court recently had occasion to pass on the question of the constitutionality of a state rule that "when the issue is ... probable cause for an arrest or search, ... police officers need not invariably be required to disclose an informant's identity if the trial judge is convinced, by evidence submitted in open court and subject to cross- examination, that the officers did rely in good faith upon credible information supplied by a reliable informant." (McCray v. Illinois (March 20, 1967) 386 U.S. 300 [18 L.Ed.2d 62, 87 S.Ct. 1056].) The court upheld the constitutional validity of such a rule. That case is controlling on the facts before us.
 The order to show cause is discharged and the peremptory writ is denied.
NOTES
[fn. 1]  1. "In any preliminary hearing, criminal trial, or other criminal proceeding, for violation of any provision of Division 10 (commencing with Section 11000) of the Health and Safety Code, evidence of information communicated to a peace officer by a confidential informant, who is not a material witness to the guilt or innocence of the accused of the offense charged, shall be admissible on the issue of reasonable cause to make an arrest or search without requiring that the name or identity of the informant be disclosed if the judge or magistrate is satisfied, based upon evidence produced in open court, out of the presence of the jury, that such information was received from a reliable informant and in his discretion does not require such disclosure."
