
12 Cal.Rptr.3d 301 (2004)
88 P.3d 36
32 Cal.4th 995
The PEOPLE, Plaintiff and Appellant,
v.
Carolyn KONOW et al., Defendants and Respondents.
No. S111494.
Supreme Court of California.
April 22, 2004.
Rehearing Denied June 23, 2004.
*302 Paul J. Pfingst and Bonnie M. Dumanis, District Attorneys, Thomas F. McArdle, Anthony Lovett, Josephine A. Kiernan and Kim Thoa Hoang, Deputy District Attorneys, for Plaintiff and Appellant.
Michael J. McCabe, under appointment by the Supreme Court, San Diego, for Defendant and Respondent Carolyn Konow.
Steven J. Carroll, Public Defender, under appointment by the Supreme Court, Matthew Braner and Selena Dong, Deputy Public Defenders, for Defendant and Respondent Steven Rohrer.
Cynthia M. Sorman, under appointment by the Supreme Court, and Diane Nichols, for Defendant and Respondent Amy Toosley.
Marianne Harguindeguy Cox, under appointment by the Supreme Court, for Defendant and Respondent Daniel O'Neil.
GEORGE, C.J.
In this case, we address two issues relating to the pretrial stage of a criminal proceeding. Under Penal Code section 871,[1] after hearing the evidence presented at a preliminary examination, a magistrate must dismiss a complaint charging a felony "[i]f ... it appears either that no public offense has been committed or that there is not sufficient cause to believe the defendant guilty of a public offense." Under section 1385, the magistrate also may dismiss such a complaint, "either of his or *303 her own motion or upon the application of the prosecuting attorney, ... in furtherance of justice." (§ 1385, subd. (a).) If the magistrate dismisses the complaint under either provision, the People may move in superior court under section 871.5 "to compel the magistrate to reinstate the complaint." (§ 871.5, subd. (a).) If the superior court orders the magistrate to reinstate the complaint, and if on remand the magistrate orders the defendant committed and an information subsequently is filed charging the defendant with the felony in question, the defendant may move in superior court to set aside the information under section 995 on the ground that he or she "had not been legally committed by [the] magistrate" or "had been committed without reasonable or probable cause." (§ 995, subd. (a)(2).)
The Court of Appeal concluded that in ruling on a motion by a defendant to set aside an information under section 995, the superior court is not authorized to review a prior order of the superior court compelling the magistrate to reinstate the complaint under section 871.5, and that the superior court would violate the California Constitution were it to do so. The Court of Appeal also concluded that the superior court may not set aside an information under section 995 when the magistrate erroneously and prejudicially failed to consider whether to dismiss the complaint in furtherance of justice under section 1385, reasoning that any such failure could not deny a defendant a substantial right affecting the legality of the commitment, because the defendant has no right formally to move for dismissal under section 1385.
We granted review to consider the two issues addressed in the Court of Appeal's decision.
As to the first issue, we conclude, contrary to the Court of Appeal's determination, that the superior court in ruling on a motion to set aside an information under section 995 is authorized to review a prior order compelling the magistrate to reinstate the complaint, and may do so without violating the California Constitution.
On the second issue, we conclude, again contrary to the Court of Appeal's determination, that the superior court may set aside an information under section 995 when the magistrate erroneously and prejudicially has failed to consider whether to dismiss a complaint in furtherance of justice under section 1385. Notwithstanding the Court of Appeal's assertion, the circumstance that a defendant has no right formally to move for dismissal under section 1385 does not negate the defendant's substantial right to the magistrate's consideration whether to exercise a power explicitly granted to the magistrate by that statute, nor does it mean that a defendant has not been denied a substantial right if the magistrate erroneously and prejudicially fails to consider whether to exercise that power.
Applying these determinations to the circumstances of the present case, we conclude that in view of the apparently unusual circumstances here disclosed, the Court of Appeal erred in reversing the order of the superior court setting aside an information under section 995. Accordingly, we reverse the judgment of the Court of Appeal and remand the cause to the Court of Appeal with directions to affirm the order in question, a disposition that will allow the magistrate to consider on remand whether to dismiss the complaint in furtherance of justice under section 1385.

I
The criminal action before us involves a prosecution under Health and Safety Code section 11360, which proscribes the sale of *304 marijuana and makes the offense punishable as a felony.
At the General Election held on November 5, 1996, the electors approved an initiative statute designated on the ballot as Proposition 215 and entitled "Medical Use of Marijuana." In pertinent part, Proposition 215 added section 11362.5 to the Health and Safety Code, a provision called the "Compassionate Use Act of 1996." (Prop. 215, § 1, as approved by electors, Gen. Elec. (Nov. 5, 1996) adding Health & Saf.Code, § 11362.5, subd. (a).) Subdivision (d) of Health and Safety Code section 11362.5 (Health and Safety Code section 11362.5(d)) provides that Health and Safety Code section 11357, which proscribes the possession of marijuana and makes the offense punishable as either a misdemeanor or a felony, and Health and Safety Code section 11358, which proscribes cultivation of marijuana and makes the offense punishable as a felony, "shall not apply to a patient, or to a patient's primary caregiver, who possesses or cultivates marijuana for the personal medical purposes of the patient upon the written or oral recommendation or approval of a physician." Health and Safety Code section 11362.5(d), however, does not refer to any other provision relating to marijuana  including Health and Safety Code section 11360, proscribing the sale of marijuana.
On May 17, 2000, a complaint was filed in the San Diego County Superior Court, charging defendants Carolyn Konow, Steven Rohrer, Amy Toosley, Daniel O'Neil, and Howard Rogers with three counts of sale of marijuana, in violation of Health and Safety Code section 11360, based on three separate transactions occurring on March 30, April 4, and April 7, 2000. Each defendant pleaded not guilty.
In papers filed in connection with the ensuing preliminary examination, the People contended that probable cause existed to believe that each defendant had sold marijuana as charged. The People also maintained that Proposition 215 did not legalize the sale of marijuana to qualified patients or primary caregivers, citing People ex rel. Lungren v. Peron (1997) 59 Cal.App.4th 1383, 70 Cal.Rptr.2d 20 (Peron) (which concluded that Proposition 215 did not create, for such persons, any exception to Health and Safety Code section 11360's proscription against the sale of marijuana), and People v. Trippet (1997) 56 Cal.App.4th 1532, 66 Cal.Rptr.2d 559 (Trippet) (which similarly concluded that Proposition 215 did not create, for such persons, any exception to Health and Safety Code section 11360's related proscription against the transportation of marijuana).
In opposition, defendants claimed that Proposition 215 should be construed to legalize the sale of marijuana to qualified patients and primary caregivers by creating an exception to Health and Safety Code section 11360. In support of their contention, defendants relied upon dictum in Peron, which stated that a qualified primary caregiver would not violate Health and Safety Code section 11360's proscription against the sale of marijuana by "receiving bona fide reimbursement for [the] actual expense of cultivating and furnishing" the substance to a qualified patient (Peron, supra, 59 Cal.App.4th at p. 1399, 70 Cal.Rptr.2d 20), and dictum in Trippet, which stated that a qualified primary caregiver would not violate Health and Safety Code section 11360's proscription against transportation of marijuana by "carrying otherwise legally cultivated and possessed marijuana down a hallway to the ... room" of a "dying cancer patient[]" (Trippet, supra, 56 Cal.App.4th at p. 1550, 66 Cal.Rptr.2d 559). In addition, defendants claimed that if, notwithstanding Proposition 215, Health and Safety Code section *305 11360 continued to proscribe the sale of marijuana to qualified patients and primary caregivers, the provision would be invalid as to such persons under the due process clause of the Fourteenth Amendment to the United States Constitution because it would be unduly vague and ambiguous and hence would deny fair notice of its proscription, and also would be invalid as to such persons under the equal protection clause of the Fourteenth Amendment because it would impermissibly expose individuals to prosecution depending solely upon the locality in which they found themselves. Finally, defendants stated their intent to raise, as "affirmative defense[s]" (§ 866, subd. (a)), what they referred to as "official authorization" and "[r]easonable reliance upon advice of counsel." Further, defendant Toosley and defendant Rogers each claimed separately that there was insufficient evidence to establish probable cause to believe that he or she was guilty of any of the sales of marijuana charged.
The preliminary examination was conducted by Judge William D. Mudd, a superior court judge sitting as a magistrate. The evidence presented, and the matters judicially noticed, disclosed the following circumstances:
The California Alternative Medicinal Center, Inc. (CAMC), was formed as a for-profit corporation in 1997, not long after the passage of Proposition 215, to distribute, and specifically to sell, marijuana to qualified patients and primary caregivers. CAMC's facility was located in the City of San Diego. Defendant Konow was CAMC's president; defendant Rohrer, Konow's son, was CAMC's vice president and research director; and both evidently were shareholders in CAMC. Defendants Toosley, O'Neil, and Rogers were CAMC employees. Toosley, who held the title of director, assisted Rohrer, handled intake procedures with clients, and dealt with physicians. O'Neil, who held the title of manager, took care of daily operations, including supervision of the marijuana dispensary. Rogers was assigned to special projects, interacted with clients, and had charge of client files.
Early on, defendant Konow consulted Marla Martinez, an attorney who practiced business law but not criminal law, regarding the adoption of procedures intended to guarantee that CAMC sold marijuana only to qualified patients and primary caregivers. Martinez provided Konow with an opinion that the procedures thereafter adopted by CAMC made its sale of marijuana lawful under Proposition 215, but not under federal law. Subsequently, CAMC modified its procedures, for example restricting its sales of marijuana to only those qualified patients and primary caregivers who had obtained recommendations or approvals from physicians within San Diego County, because of CAMC's concerns about recommendations or approvals from physicians outside the county. Konow acknowledged to the press that CAMC's activities were "outside the envelope," including its acquisition of marijuana from sources she refused to identify other than its having been cultivated, but she also stated her belief that "helping [CAMC's] clients is worth being outside the envelope." CAMC's income was $12,208.50 for the last three months of 1997, $211,239 for 1998, $444,306.50 for 1999, and $162,531 for the first three months of 2000.
Beginning in 1998, the Cities of Arcata, Oakland, and Santa Cruz, and the City and County of San Francisco, all located in Northern California, began to pass ordinances purportedly implementing Proposition 215. Each measure was applicable only to conduct within the locality's boundaries. Neither San Diego County nor the *306 City of San Diego passed any such ordinance.
In early 1998, defendant Konow met with the San Diego City Attorney to ask him for a "public endorsement" of CAMC's business of selling marijuana to qualified patients and primary caregivers. Although remarking that "Proposition 215 was a badly written law," the city attorney declined to give Konow any such endorsement and recommended that she speak with the Chief of Police of the City of San Diego as well as the district attorney. The city attorney subsequently expressed to the press his opinion that CAMC "seem[s] to be complying with the spirit and letter of a very badly drafted law," and that "frankly, law enforcement has bigger things to worry about than someone with a serious ailment discreetly smoking marijuana at home."
In mid-1999, a deputy district attorney visited CAMC on a matter unrelated to the charges alleged in the complaint. After receiving a tour of the facility, the deputy district attorney stated her view to defendant Konow and others that "they were doing a good job and achieving their goals in operating an above board establishment and trying to prevent abuse."
In early 2000, defendant Konow scheduled a meeting with the chief of police but, because he was unavailable on the date set, instead met with the assistant chief of police. The assistant chief subsequently sent Konow a letter stating that the "Police Department is sympathetic to the needs of the sick and it is not our intention to prevent patients from legally obtaining medicinal marijuana," but also stating that "Proposition 215 does not provide for the selling ... of marijuana," that the selling of marijuana is "in violation of law and beyond the scope of Proposition 215," and that "if you or representatives of [CAMC] continue to sell marijuana you are in violation of the law and may be subject to criminal prosecution," inasmuch as the police department "can neither condone nor ignore illegal activity."
On January 6, and March 7, 2000, in sting operations involving a female undercover agent named Wood, who was not a qualified patient or primary caregiver, Agent James Hawksley of the San Diego Police Department sought to purchase marijuana from CAMC, but was unable to do so because Wood failed to provide the personal qualifications required by CAMC.
On March 30, April 4, and April 7, 2000, however, Agent Hawksley succeeded in purchasing marijuana from CAMC in sting operations involving a male undercover agent named Polsky and two former CAMC volunteers, William Aaron, an AIDS patient, and Sam McBride, his partner, neither of whom apparently was a qualified patient or primary caregiver. Specifically, on March, 30 McBride went to CAMC together with Polsky and bought four grams of marijuana for Aaron from defendant O'Neil for $100. The marijuana was packaged in a heat-sealed plastic bag with a "CAMC" label. As McBride and Polsky were leaving the facility, defendant Rohrer and defendant Toosley were entering it. On April 4, again accompanied by Polsky, McBride went to CAMC and bought an additional four grams of marijuana, in a similar bag, from O'Neil for $100. On that date, McBride and Polsky also met with Rohrer and Toosley, and Toosley provided a CAMC investment brochure to Polsky, who was posing as a potential investor. Finally, on April 7, McBride went to CAMC together with Polsky and this time bought eight grams of marijuana, in a similar bag, from O'Neil for $200. McBride and Polsky encountered Rohrer and Toosley during the same transaction, and shortly thereafter Polsky *307 met with Rohrer and Toosley over lunch to discuss CAMC's financial prospects.
At the conclusion of the preliminary examination, the magistrate ordered the complaint dismissed as to all of the defendants.
With respect to defendant Rogers, the magistrate dismissed the complaint for insufficiency of the evidence to establish probable cause to believe that Rogers was guilty of any of the sales of marijuana charged. In doing so, the magistrate commented: "On a purely evidentiary basis, there's a total and a complete lack of sufficient evidence as to Mr. Rogers under any legal theory to make him an aider and abettor or principal or any other theory in this case."
With respect to defendants Konow, Rohrer, Toosley, and O'Neil, the magistrate dismissed the complaint on the ground that in light of Proposition 215, Health and Safety Code section 11360 was invalid as applied to sales to qualified patients and primary caregivers, both under the Fourteenth Amendment's due process clause, because it was unduly vague and ambiguous and hence denied fair notice of its proscription, and also under the Fourteenth Amendment's equal protection clause, because it impermissibly exposed individuals to prosecution depending solely upon the locality in which they found themselves. As summarized in the pertinent minute orders, the magistrate's grounds for the dismissal were as follows: "1  Statute is vague and ambiguous[.]2  Denial of equal protection[.]3  Denial of due process [.]" The magistrate stated he "recognize[d] that the potential for this obviously is to have this statute ruled unconstitutional.... I have no idea where it's going. I have absolutely no clue as to where it's going. But in this small corner of the world, it's very clear to me that these folks are in an untenable position...."
In the course of his ruling, the magistrate commented that Proposition 215 was a "poorly drafted piece of legislation" that "fails the due process test as required by the United States Constitution. The business known as California Alternative Medicinal Center, C.A.M.C., has taken all steps necessary to comply with the statute, and the ambiguity of the very statute is what leads to these parties being charged in a criminal proceeding. [¶] Given the ongoing cooperation and the outright desire of the leaders of this corporation to not only comply with the law but get the recommendation of the community's law enforcement officials, I'm deeply troubled by and wonder why this business was not challenged in a civil arena, not with the charging of irreducible felonies. [¶] At any rate, the statute fails to put the parties on notice and fails certainly to put the charged parties in this case on notice of what is proscribed, thus violating their right to due process."
The magistrate further commented that "there are at least four cities of this state which have implemented [Proposition 215] in such a way as would make these defendants' operation completely legal in their communities. If this is not a violation of the equal protection clause of the Constitution, it's hard to find one. Here the mere charging of the crime is based solely on the fact the defendants reside in San Diego, a county that is still trying to get a consensus on a piece of legislation that was passed in 1996.... Again, I wonder why under the circumstances this falls into a criminal court. It's very apparent to me that these folks are here for one of two reasons. One is the statute is so botched up that nobody can really determine what's illegal and what isn't. Or, number two, what is clearly legal conduct *308 in four communities of this state ha[s] been deemed illegal in this county. For all of those statutory reasons, it's very apparent to me there have been violations of equal protection...."
As for the construction of Proposition 215 creating an exception to Health and Safety Code section 11360 for sales to qualified patients and primary caregivers, the magistrate apparently concluded that such an exception logically was needed for Proposition 215 to "make[ ] ... sense," but simply did not exist as a matter of fact. As for the affirmative defenses of official authorization and reasonable reliance upon advice of counsel, the magistrate stated that they "are very interesting, but they weren't persuasive in this particular case. So I'm not using them for any reason. I prefer to rest the decision solely on the square of the statutory interpretations and the uncertainties that are inherent."
Thereafter, the People moved in the superior court under section 871.5 to compel the magistrate to reinstate the complaint as to defendants Konow, Rohrer, Toosley, and O'Neil, but not as to defendant Rogers. The People contended that there was probable cause to believe that each of these defendants was guilty of the sales of marijuana charged, that Proposition 215 did not legalize the sale of marijuana to qualified patients or primary caregivers, and that even as to such persons, Health and Safety Code section 11360 was not invalid under the Fourteenth Amendment's due process or equal protection clauses. The People took the position that "it is apparent" from the magistrate's "reasoning" that "he dismissed the complaint under either or both ... sections 871 or 1385"  section 871, which requires a magistrate to dismiss a complaint for the absence of a crime or of probable cause, and section 1385, which authorizes a magistrate to dismiss a complaint in furtherance of justice.
Defendants opposed the People's motion to compel the magistrate to reinstate the complaint under section 871.5. Defendants generally disputed each of the People's contentions but, like the People, took the position that the magistrate had dismissed the complaint both for the absence of a crime or of probable cause under section 871, and also in furtherance of justice under section 1385.
After a hearing in superior court, Judge Howard H. Shore granted the People's motion to compel the magistrate to reinstate the complaint under section 871.5. In granting the motion, Judge Shore concluded that Proposition 215 did not create any exception to Health and Safety Code section 11360 to allow sales to qualified patients and primary caregivers, that the provision was not invalid as to such sales under either the due process or equal protection clauses of the Fourteenth Amendment, that the affirmative defenses of official authorization and reasonable reliance upon advice of counsel were unavailable, and that, accordingly, the magistrate erred in dismissing the complaint  whether under section 871 for the absence of a crime or of probable cause, or in furtherance of justice under section 1385  based on an incorrect view of the law. Judge Shore recognized that "everybody spent most of their time [at the preliminary examination] talking about the defenses, such as due process and equal protection, and that no one really made any argument as to the facts.... [¶] ... [T]here was nothing in [the magistrate's] ruling that indicated what his feelings were about the specific culpability of any particular defendant, because he spent his time stating that he felt this was an unconstitutional application of law to them and I can understand from his *309 perspective, if that's the case: Why bother talking about the facts[?]"
After Judge Shore announced his ruling, counsel for defendant Konow requested a clarification of its scope: "You indicated that you were reversing [the magistrate's] determination or utilization of his power [in furtherance of justice under section 1385] ... insofar as it relied on erroneous interpretations of the law. [¶] Do you mean by that [the magistrate] may revisit that issue, if the exercise of discretion is not based upon his evaluation  neutral evaluation  of the circumstances, apart from such an interpretation?" Judge Shore responded: "You mean can he find ways to get around my rulings?" Counsel replied: "I guess so." Judge Shore stated: "No."
In accordance with his ruling, Judge Shore ordered the magistrate to reinstate the complaint under section 871.5 and, more specifically, ordered him to resume the preliminary examination in order to determine whether sufficient evidence exists to establish probable cause to believe that any of the defendants is guilty of any of the sales of marijuana charged.
On remand, the magistrate, who again was Judge Mudd, reinstated the complaint against defendants Konow, Rohrer, Toosley, and O'Neil under section 871.5. At the resumed preliminary examination, the magistrate determined that sufficient evidence existed to establish probable cause to believe that each of the defendants was guilty of each of the sales of marijuana charged. In accordance with his determination, the magistrate ordered each of the defendants committed and bound over to answer at trial, albeit "begrudgingly." Defendants had invited the magistrate to dismiss the complaint, on his own motion, in furtherance of justice under section 1385, in light of the particular facts of the case. The magistrate declined the invitation, believing that by being compelled to reinstate the complaint under section 871.5, he was precluded from ordering dismissal on that basis: "[T]his lowly magistrate is under a direct order to basically rule on the sufficiency of the evidence for purposes of bindover. [¶] I would dearly love to accept your invitation because I still believe that justice in this community is being subverted to a certain extent, if not totally, in the facts of this case. But that will be for another judge at another time in another place."[2]
Immediately thereafter, the People filed an information charging defendants with three counts of sale of marijuana in terms identical to the complaint. Each of the defendants pleaded not guilty.
Subsequently, defendants moved in the superior court to set aside the information under section 995 on the ground that they had not been legally committed by the magistrate, because Judge Shore erroneously compelled the magistrate to reinstate the complaint under section 871.5, leading to the order of commitment. Defendants claimed, among other things, that Judge Shore erred in concluding that Health and Safety Code section 11360 was not invalid as applied to sales to qualified patients and primary caregivers under either the due process or equal protection clauses of the Fourteenth Amendment, that Proposition 215 did not create any exception to Health and Safety Code section 11360 for sales to such individuals, that the magistrate erred in dismissing the complaint under section 1385 in furtherance of justice based on an incorrect view *310 of the law, and that in any event Judge Shore erred in precluding the magistrate from considering whether to order dismissal in furtherance of justice under section 1385 in light of the particular facts of the case. Defendant Toosley separately moved to set aside the information as to herself alone, on the ground that she had been committed by the magistrate without sufficient evidence to establish probable cause to believe she was guilty of any of the charged sales of marijuana.
The People opposed defendants' motion to set aside the information under section 995, taking issue with each of defendants' claims. At the threshold, in order to preserve the issue for appeal, the People argued that, contrary to the holding of Los Angeles Chemical Co. v. Superior Court (1990) 226 Cal.App.3d 703, 276 Cal.Rptr. 647 (Los Angeles Chemical) and In re Torres (1982) 128 Cal.App.3d 826, 180 Cal.Rptr. 700 (Torres), the superior court, in ruling on a motion to set aside an information under section 995, is not authorized to review a prior order of the superior court compelling the magistrate to reinstate the complaint under section 871.5. The People also argued that, contrary to the holding of Los Angeles Chemical, the superior court's exercise of such review violates the California Constitution. The People also opposed defendant Toosley's separate motion to set aside the information, contending that she had been committed by the magistrate with sufficient evidence to establish probable cause to believe she was guilty of the sales of marijuana charged.
Following a hearing on the motions to set aside the information under section 995 before Judge Michael D. Wellington, Judge Wellington granted defendants' motion, although denying defendant Toosley's separate motion.
In his ruling, Judge Wellington concluded that, in compelling the magistrate to reinstate the complaint under section 871.5, Judge Shore was correct in concluding that Health and Safety Code section 11360 was not invalid as applied to sales to qualified patients or primary caregivers under either the due process or equal protection clauses of the Fourteenth Amendment, and also was correct in concluding that Proposition 215 did not create any exception for sales to such persons. But Judge Wellington went on to conclude that, on remand at the resumed preliminary examination, the magistrate had denied defendants a substantial right affecting the legality of the commitment by erroneously and prejudicially failing to consider whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case. Because Judge Wellington's resolution of this issue is central to the questions before us, we review his reasoning in some detail.
Judge Wellington first concluded that, at the initial preliminary examination, the magistrate did not dismiss the complaint in furtherance of justice under section 1385, but rather under section 871 for the absence of evidence of a sale of marijuana as proscribed by a valid statute, based on the magistrate's conclusion that in light of Proposition 215, Health and Safety Code section 11360 was invalid as applied to sales to qualified patients and primary caregivers under the Fourteenth Amendment's due process and equal protection clauses. Although both the People and defendants evidently believed that the magistrate ordered dismissal in furtherance of justice under section 1385, Judge Wellington stated: "I don't see that anywhere.... It doesn't say it in the transcript. It doesn't say it in the minute order." The absence of evidence of a sale of marijuana as proscribed by a valid statute "would be a whole independent separate *311 reason to discharge the case." The furtherance of justice provision of section 1385 would be "surplusage" in that ruling, in Judge Wellington's view. He stated: "[I]t's hard for me to imagine that [the magistrate], the trial judge in [People v. Superior Court (Romero) (1996) 13 Cal.4th 497, 53 Cal.Rptr.2d 789, 917 P.2d 628], one of the landmark California cases on [dismissal in furtherance of justice under section 1385]  which, when it got to the Supreme Court, reaffirmed dramatically all the requirements [for such dismissals]  a judge who I think was dramatically vindicated, the trial judge was vindicated on his views on [such dismissals] in that decision, it strains my imagination that if, at the prelim, he wanted to [dismiss in furtherance of justice], he wouldn't have said so and gone through the drill on it."
Judge Wellington next concluded that Judge Shore did not preclude the magistrate from considering, at the resumed preliminary examination, whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case. To the extent Judge Shore intended to preclude the exercise of such power, according to Judge Wellington, Judge Shore intended to do so only insofar as the magistrate might rely on an incorrect view of the law. "I think Judge Shore's intention ... was that, `No. The Constitution  You can't find another way to reach that constitutional conclusion.' Judge Shore was really saying that the defective constitutional analysis wasn't a good basis" for dismissal in furtherance of justice.
Judge Wellington then concluded that had Judge Shore precluded the magistrate from considering, at the resumed preliminary examination, whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case, Judge Shore would have erred by going beyond the "grounds" on which the magistrate had rested his dismissal, which was his interpretation of the law. Judge Wellington determined, "I don't think [Judge Shore] had the authority to do that."
Finally, Judge Wellington went on to conclude that, on remand at the resumed preliminary examination, the magistrate erroneously and prejudicially failed to consider whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case, and thereby denied defendants a substantial right affecting the legality of the commitment. In reaching his conclusion that the magistrate erred, Judge Wellington acknowledged that "defendants have no right to bring a ... motion [for such a dismissal]. They have no right to have [such] a ... motion granted. [¶] But I think they have a right to have their hearing conducted in front of a magistrate who ... is capable of and willing to exercise all the authorities of a magistrate, and the magistrate does have ... powers" to dismiss on that basis. Likewise, in concluding that the magistrate's error was prejudicial, Judge Wellington noted that the magistrate expressed a strong desire to order dismissal.
The People appealed from Judge Wellington's order setting aside the information under section 995. (§ 1238, subd. (a)(1).) On appeal, the Court of Appeal reversed the order and remanded the cause with directions to reinstate the information. The Court of Appeal based its decision on alternative grounds.
First, the Court of Appeal concluded that Judge Wellington erred in granting defendants' motion to set aside the information under section 995 insofar as he held that the magistrate had denied defendants a substantial right affecting the legality of the commitment by erroneously *312 and prejudicially failing to consider whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case. On this point, the Court of Appeal reasoned that the magistrate could not have denied defendants a substantial right by committing error with respect to the exercise of his power to order dismissal under section 1385, because a defendant has no right formally to make a motion requesting that the magistrate exercise such power.
Second, the Court of Appeal concluded that Judge Wellington erred in granting defendants' motion to set aside the information under section 995 insofar as he based his ruling on a review of Judge Shore's order compelling the magistrate to reinstate the complaint under section 871.5. On this point, the Court of Appeal reasoned that one superior court judge is not authorized to review an order by another superior court judge and in fact would violate the California Constitution by doing so.
On separate petitions by defendants Konow and Rohrer, defendant Toosley, and defendant O'Neil, we granted review. For the reasons that follow, we reverse the judgment rendered by the Court of Appeal.

II

A
The first issue before us is whether, in ruling on a motion to set aside an information under section 995, the superior court is authorized to review a prior superior court order compelling the magistrate to reinstate the complaint under section 871.5, and whether the superior court may do so without violating the California Constitution. As we shall explain, we initially conclude that such review is proper and does not violate the state Constitution.
To begin with, contrary to the conclusion of the Court of Appeal, we find that the authorization for such review is quite clear. The governing provisions are section 871.5, relating to reinstatement of a complaint,[3] and section 995, relating to *313 setting aside an information.[4] Section 871.5 expressly provides: "If [a] motion to reinstate the complaint is granted, the defendant may seek review thereof ... pursuant to Section[] 995," that is, by a motion to set aside the information. (§ 871.5, subd. (f).) Section 871.5 itself thereby clearly authorizes the superior court to review an order compelling the magistrate to reinstate the complaint under section 871.5 in conjunction with ruling on a subsequent motion to set aside the information under section 995. Both Los Angeles Chemical and Torres so hold. (See Los Angeles Chemical, supra, 226 Cal.App.3d at pp. 709-711, 276 Cal.Rptr. 647; Torres, supra, 128 Cal.App.3d at pp. 828-829, 180 Cal.Rptr. 700.)
In concluding to the contrary, the Court of Appeal below failed to consider the plain language of section 871.5, which authorizes the superior court to "review" an order granting a "motion to reinstate the complaint" under section 871.5 as it rules on a subsequent motion by a defendant to set aside the information "pursuant to Section[ ] 995" (§ 871.5, subd. (f)). Instead, the Court of Appeal claimed that "the purpose of a ... motion [to set aside the information under section 995] following a resumed preliminary hearing after the *314 grant of a[ ] ... motion [to compel the magistrate to reinstate the complaint under section 871.5] is to allow the superior court to review the additional proceedings before the magistrate  not to grant a defendant a second review of the issue reviewed by the court that granted the ... [reinstatement] motion...." In support of this assertion, the Court of Appeal quoted a passage in Los Angeles Chemical that states that in ruling on a motion to set aside an information under section 995, the superior court is authorized to review "issues other than those involved in the order reinstating the complaint" (Los Angeles Chemical, supra, 226 Cal.App.3d at p. 711, 276 Cal.Rptr. 647). But as we shall demonstrate, the passage quoted from Los Angeles Chemical does not bear the meaning attributed to it by the Court of Appeal.
In Los Angeles Chemical, the defendants were charged with unlawful disposal of hazardous waste. At the preliminary examination, the magistrate granted a motion by the defendants to suppress certain evidence as unconstitutionally obtained and dismissed the complaint, apparently determining that in the absence of such evidence, probable cause did not exist to believe that the defendants were guilty of unlawful disposal of hazardous waste. The superior court granted a motion by the People to compel the magistrate to reinstate the complaint under section 871.5. On remand, following resumption of the preliminary examination, the magistrate ordered the defendants committed, and the People subsequently filed an information. At that point, the defendants submitted a petition for writ of prohibition to the Court of Appeal seeking review, among various matters, of the superior court's order compelling the magistrate to reinstate the complaint under section 871.5.
After issuance of an alternative writ and oral argument, the Court of Appeal in Los Angeles Chemical denied the petition. In reaching its decision, the Court of Appeal reasoned that, prior to submitting their petition for writ of prohibition to the appellate court, the defendants were required to make a motion in the superior court to set aside the information under section 995. "[S]ection 871.5 provides that `the exclusive statutory remedy to test the propriety of [an] order of reinstatement' is a motion in the superior court to set aside the information, followed by a writ of prohibition in the appellate court. [Citations.] [The defendants] failed to comply with the requirements of section 871.5, and accordingly the petition for writ of prohibition must be denied." (Los Angeles Chemical, supra, 226 Cal.App.3d at p. 711, 276 Cal.Rptr. 647.)
In the course of its analysis, the Court of Appeal in Los Angeles Chemical addressed a contention by the defendants that they should not be required to make a motion in the superior court to set aside the information under section 995 prior to submitting a petition for writ of prohibition to the Court of Appeal, "because doing so `would be tantamount to renewing a ... motion [to set aside the information under section 995] without showing any "changed circumstances," `in violation of the rule announced in In re Kowalski (1971) 21 Cal.App.3d 67, 98 Cal.Rptr. 444.[¶] In Kowalski, the defendant's motion to set aside the indictment ... was granted and the case dismissed. Subsequently, another judge of the same court ruled that the previous order of dismissal was invalid and reset the case for trial. The Court of Appeal granted a writ of habeas corpus and ordered the defendant discharged from custody, concluding the second judge had erred in considering matters already ruled on by another judge of the same court `without any showing of changed circumstances.' [Citation.] [¶] [The defendants] contend the holding in Kowalski is *315 applicable to the present case." (Los Angeles Chemical, supra, 226 Cal.App.3d at p. 710, 276 Cal.Rptr. 647.)
The Court of Appeal in Los Angeles Chemical, rejecting the defendants' contention, held as follows: "A similar argument recently was rejected in Sandco American, Inc. v. Notrica (1990) 216 Cal.App.3d 1495, 265 Cal.Rptr. 587. The trial judge in Sandco granted a new trial on the ground that another department of the trial court had imposed an erroneous discovery cutoff date which constituted an irregularity in the proceedings, depriving the defendant of a fair trial within the meaning of Code of Civil Procedure section 657, subdivision 1. The Court of Appeal rejected the argument that the holding in Kowalski prohibits a trial judge from granting a new trial based upon the conclusion that a different department of the same court had made an erroneous ruling. The appellate court stated: `Section 657, subdivision 1, authorizes the trial judge to grant a new trial based on a finding of irregularity in the proceedings of "the court." When a trial judge acting under this statutory authority considers orders of another judge as proceedings of the court, there is no inconsistency with the general rule that jurisdiction is in the court and that the judges hold but one and the same court.'" (Los Angeles Chemical, supra, 226 Cal.App.3d at p. 710, 276 Cal.Rptr. 647, fn. omitted.)
The Court of Appeal in Los Angeles Chemical then observed: "In the present case ... section 871.5 requires that if a preliminary hearing is resumed following the granting of a motion to reinstate the complaint [under section 871.5], a defendant who is held to answer and wishes to seek review of the order reinstating the complaint must move to set aside the ... information pursuant to ... section 995. There is no inconsistency between this statutory requirement and the general rule prohibiting a judge from interfering with the exercise of the power of another department of the same court. [¶] Several valid purposes are served by section 871.5. First, requiring the defendant to bring a motion [to set aside the information] pursuant to ... section 995 under these circumstances affords the superior court an opportunity to rule on all issues involving the validity of the order holding the defendant to answer before the defendant seeks appellate review, thus eliminating the need for successive petitions for writ review. Second, the superior court is provided an opportunity to rule upon any issues raised by the admission of additional evidence at the resumed preliminary hearing, prior to review by the appellate court. Finally, the need for appellate review may be obviated altogether by the superior court's rulings on issues other than those involved in the order reinstating the complaint." (Los Angeles Chemical, supra, 226 Cal.App.3d at pp. 710-711, 276 Cal.Rptr. 647.)
From this review, it is clear that Los Angeles Chemical does not provide any support for the conclusion reached by the Court of Appeal below. Contrary to that court's assertion, Los Angeles Chemical's "procedural posture" has no significance in the resolution of the issue before us. A careful reading of the language in Los Angeles Chemical stating that in ruling on a motion to set aside an information under section 995, the superior court is authorized to review "issues other than those involved in the order reinstating *316 the complaint" under section 871.5 (Los Angeles Chemical, supra, 226 Cal.App.3d at p. 711, 276 Cal.Rptr. 647, italics added) discloses that  under the opinion in Los Angeles Chemical  the superior court is authorized to review issues in addition to those involved in the order reinstating the complaint, and not issues to the exclusion of those involved in the order reinstating the complaint. Los Angeles Chemical makes it plain that the superior court is authorized to "rule on all issues involving the validity" of the magistrate's order of commitment, which necessarily include the order compelling the magistrate to reinstate the complaint under section 871.5. (Los Angeles Chemical, supra, 226 Cal.App.3d at p. 711, 276 Cal.Rptr. 647, italics added.)
Having concluded that the superior court clearly is authorized by section 871.5 itself to review a prior order compelling the magistrate to reinstate the complaint under section 871.5 in conjunction with ruling on a motion by a defendant to set aside an information under section 995, we now conclude, contrary to the Court of Appeal, that such review does not violate the California Constitution.
In Los Angeles Chemical, the Court of Appeal concluded that in ruling on a motion to set aside an information under section 995, the superior court may review a prior order compelling the magistrate to reinstate the complaint under section 871.5 without violating the California Constitution, specifically article VI, section 4, which declares that the superior court in each county is a single entity no matter the number of its judges.[5] In so concluding, the Court of Appeal looked to Sandco American, Inc. v. Notrica (1990) 216 Cal.App.3d 1495, 265 Cal.Rptr. 587 (Sandco), which distinguished In re Kowalski (1971) 21 Cal.App.3d 67, 98 Cal.Rptr. 444 (Kowalski), and Williams v. Superior Court (1939) 14 Cal.2d 656, 96 P.2d 334 (Williams).
In Williams, we addressed the question whether a judge of a department of the superior court exceeded his jurisdiction. The judge in department 34 had ordered a court reporter immediately to begin preparation of a reporter's transcript of certain oral proceedings in accordance with the reporter's written agreement with an appellant. After the passage of some time, the judge in department 34 subsequently ordered the court reporter to show cause why he should not be adjudged guilty of contempt for failing to comply with the judge's previous order for preparation of the reporter's transcript. The judge in department 12 thereupon issued an order that, among other things, purported to declare void for want of jurisdiction the order for preparation of the reporter's transcript made by the judge in department 34, upon which the judge in department 34 based his subsequent order to show cause concerning contempt.
We held that "in making the foregoing order the judge of department 12" had "exceeded his jurisdiction." (Williams, supra, 14 Cal.2d at p. 662, 96 P.2d 334.) Our reasoning was as follows: "The state Constitution [citation] provides for but one superior court in each county.... Accordingly, it has been held that jurisdiction is vested by the Constitution in the court and not in any particular judge or department thereof; and that whether sitting separately or together, the judges hold but one and *317 the same court. [Citation.] It follows, therefore, that where a proceeding has been duly assigned for hearing and determination to one department of the superior court ..., and the proceeding so assigned has not been finally disposed of therein or legally removed therefrom, it is beyond the jurisdictional authority of another department of the same court to interfere with the exercise of the power of the department to which the proceeding has been so assigned. [Citation.] In other words, while one department is exercising the jurisdiction vested by the Constitution in the superior court of that county, the other departments thereof are as distinct therefrom as other superior courts. [Citation.] If such were not the law, conflicting adjudications of the same subject-matter by different departments of the one court would bring about an anomalous situation and doubtless lead to much confusion. [Citation.] [¶] Here, as will be noted, at the time the judge of department 12 made the order under review, the proceeding which had been duly assigned to department 34 for hearing and determination had not been finally disposed of therein. The contempt proceeding invoked for the enforcement of the court's previous order was still pending, and during the pendency thereof the judge of department 12 made the order in question, the obvious purport of which was to nullify the proceedings which were then taking place in department 34. This the judge of department 12 was without jurisdiction to do.... [T]he judge presiding in one department has the power to make and enforce all orders necessary for the disposition of the proceeding that has been assigned to his department, and no judge sitting in any other department can interfere with him in the exercise of such power." (Williams, supra, 14 Cal.2d at pp. 662-663, 96 P.2d 334.)
In Kowalski, the Court of Appeal granted a defendant's petition for writ of habeas corpus and ordered him released from custody. One judge of the superior court, having granted a motion by the defendant to set aside an indictment returned against him, ordered the action dismissed. Later, another judge of the superior court, taking the position that the dismissal was void as in excess of the first judge's jurisdiction, purported to order the dismissal set aside, set a date for trial, and fixed bail. The Court of Appeal, following Williams, held that the second judge's order purporting to set aside the dismissal was itself void and observed: "`"A superior court is but one tribunal, even if it be composed of numerous departments.... An order made in one department during the progress of a cause can neither be ignored nor overlooked in another department...."'" (Kowalski, supra, 21 Cal.App.3d at p. 70, 98 Cal.Rptr. 444.)
In Sandco, the Court of Appeal read Williams and Kowalski to stand for the proposition that under article VI, section 4, of the California Constitution, "one [judge or] department of the superior court cannot enjoin, restrain, or otherwise interfere with the judicial act of another [judge or] department of the superior court." (Sandco, supra, 216 Cal.App.3d at p. 1508, 265 Cal.Rptr. 587, citing Ford v. Superior Court (1986) 188 Cal.App.3d 737, 742, 233 Cal.Rptr. 607.) The Court of Appeal in Sandco implied that a later "judge ... [who] considers orders of [an earlier] judge" does not "`enjoin, restrain, or otherwise interfere with the judicial act'" of the earlier judge when the later judge "act[s] under ... statutory authority." (Sandco, supra, 216 Cal.App.3d at pp. 1508-1509, 265 Cal.Rptr. 587, citing Ford v. Superior Court, supra, 188 Cal.App.3d at p. 742, 233 Cal.Rptr. 607.) As a consequence, the Court of Appeal in Sandco upheld the "propriety of basing a new trial order on error the trial judge finds in the *318 order or orders of another judge of the same court" (Sandco, supra, 216 Cal.App.3d at p. 1508, 265 Cal.Rptr. 587): "[I]t is apparent that such a new trial order" by a later judge, under authority of Code of Civil Procedure section 657, subdivision 1, "does not operate to `enjoin, restrain, or otherwise interfere with the judicial act' "of an earlier judge who issued the erroneous order or orders in question. (Sandco, supra, 216 Cal.App.3d at p. 1509, 265 Cal.Rptr. 587, quoting Ford v. Superior Court, supra, 188 Cal.App.3d at p. 742, 233 Cal.Rptr. 607.)
We agree with Sandco that the superior court, in ruling on a motion for new trial, may review a prior order without violating article VI, section 4, of the California Constitution, whether the same judge reviews his or her own order or one judge reviews an order of another judge, because in ruling on the new trial motion the superior court acts under authority of Code of Civil Procedure section 657, subdivision 1.
Therefore, we agree as well with Los Angeles Chemical that the superior court, in ruling on a motion to set aside an information under section 995, may review a prior order compelling the magistrate to reinstate the complaint under section 871.5 without violating article VI, section 4, of the California Constitution, whether the same judge reviews his or her own reinstatement order or one judge reviews the reinstatement order of another judge, because  in ruling on the motion to set aside the information  the superior court acts under authority of sections 871.5 and 995.
The Court of Appeal below, however, concluded that the superior court, in ruling on a motion to set aside an information under section 995, may not review a prior order compelling the magistrate to reinstate the complaint under section 871.5 without violating article VI, section 11, of the California Constitution, which grants appellate jurisdiction over the judgments of the superior court to the Court of Appeal and the Supreme Court, but not to the superior court.[6]
The Court of Appeal did not cite any authority in support of the foregoing conclusion. Being unaware of any such authority ourselves, we conclude that the Court of Appeal's determination cannot be sustained. The recent decision in In re Alberto (2002) 102 Cal.App.4th 421, 125 Cal.Rptr.2d 526 is in accord with the conclusion we reach. The appellate court in that case addressed the question whether, after one judge of the superior court sets bail for a defendant, another judge of the superior court may increase bail solely because the second judge believes that the first judge erred  independent of the authority granted by section 1289, which allows review of bail setting for good cause based on changed circumstances. At the outset of its analysis, the Court of Appeal acknowledged that "[t]here is little debate that in a criminal cause the court generally *319 has the [inherent] authority to correct its own prejudgment errors. (In re Alberto, supra, 102 Cal.App.4th at p. 426, 125 Cal.Rptr.2d 526.) In criminal cases, there are few limits on a courts [inherent] power to reconsider interim rulings ... .... [ ] This rule is founded on our preference for justice over the rigid adherence to procedure. A court could not operate successfully under the requirement of infallibility in its interim rulings. Miscarriage of justice results where a court is unable to correct its own perceived legal errors, particularly in criminal cases where life, liberty, and public protection are at stake. Such a rule would be ... a serious impediment to a fair and speedy disposition of causes.... (Id. at pp. 426-427, 125 Cal.Rptr.2d 526.) The Court of Appeal observed, however, that [d]ifferent policy considerations ... are operative if the reconsideration is accomplished by a different judge. Accordingly, the general rule is just the opposite: the [inherent] power of one judge to vacate an order made by another judge is limited. [Citation.] This principle ... is designed to ensure the orderly administration of justice and to prevent one judge from plac [ing] himself or herself in the role of a one-judge appellate court" over another judge. (Id. at p. 427, 125 Cal.Rptr.2d 526.) The Court of Appeal went on to answer the question before it in the negative, concluding that the second judge may not increase bail solely because that judge believes that the first judge erred, independent of the authority granted by section 1289. The appellate court concluded, however, that when the second judge acts in accordance with the authority granted by section 1289, that judge properly may increase bail, as warranted, over the amount set by the first judge.
Similarly, we conclude that when one judge, in ruling on a motion to set aside an information under section 995, reviews an order of another judge compelling the magistrate to reinstate the complaint under section 871.5, under the authority granted by section 871.5 itself, the first judge acts properly, and does not threaten the orderly administration of justice or place himself or herself in the role of a one-judge appellate court over the second judge.
In sum, we disagree with the Court of Appeal and conclude that, in ruling on a motion to set aside an information under section 995, the superior court is authorized to review a prior order compelling the magistrate to reinstate the complaint under section 871.5, and may do so without violating the California Constitution. Accordingly, we further conclude that in considering defendants' motion to set aside the information in the present case, Judge Wellington acted both within his authority and consistently with the California Constitution.[7]

B
The second question before us is whether the superior court may set aside an information under section 995 when the magistrate erroneously and prejudicially has failed to consider whether to dismiss *320 the complaint in furtherance of justice under section 1385. As we shall explain, we conclude that the superior court may do so.
The Court of Appeal below concluded that the superior court may not set aside an information under section 995 on the basis of the magistrate's erroneous and prejudicial failure to consider whether to dismiss the complaint in furtherance of justice under section 1385, reasoning that any such failure could not deny a defendant a substantial right affecting the legality of the commitment because a defendant has no right formally to move for dismissal under that statute.
It is true that a defendant does not have a right formally to make a motion before a magistrate to dismiss a complaint in furtherance of justice under section 1385. By its terms, section 1385 provides for the magistrate to exercise his or her authority to dismiss on this basis only on "his or her own motion or upon the application of the prosecuting attorney." (§ 1385, subd. (a).)[8] It is settled, however, that a defendant may "informally suggest" that the magistrate consider dismissal on the magistrate's own motion. (People v. Smith (1975) 53 Cal.App.3d 655, 657, 126 Cal.Rptr. 195 [with reference to a trial court]; accord, People v. Superior Court (Flores) (1989) 214 Cal.App.3d 127, 137, 262 Cal.Rptr. 576 [same]; see Rockwell v. Superior Court (1976) 18 Cal.3d 420, 441-442, 134 Cal.Rptr. 650, 556 P.2d 1101 [same].)
Contrary to the Court of Appeal's view, the circumstance that a defendant does not have a right formally to make a motion before a magistrate to dismiss a complaint in furtherance of justice under section 1385 does not determine the question whether the magistrate's erroneous and prejudicial failure to consider whether to order dismissal on that basis could deny the defendant a substantial right affecting the legality of the commitment.
In People v. Pompa-Ortiz (1980) 27 Cal.3d 519, 165 Cal.Rptr. 851, 612 P.2d 941, in which we held that the defendant had a "substantial right" to a public preliminary examination and that this right was "denied" when the preliminary examination was closed (id. at p. 526, 165 Cal.Rptr. 851, 612 P.2d 941), we cited several decisions[9] standing for the proposition *321 that "denial of a substantial right at the preliminary examination renders the ensuing commitment illegal and entitles a defendant to dismissal of the information on timely motion" (People v. Pompa-Ortiz, supra, 27 Cal.3d. at p. 523, 165 Cal.Rptr. 851, 612 P.2d 941).
In determining whether a magistrate's erroneous and prejudicial failure to consider whether to dismiss a complaint in furtherance of justice under section 1385 can deny a defendant a substantial right affecting the legality of the commitment, we find guidance in Jennings v. Superior Court, supra, 66 Cal.2d 867, 59 Cal.Rptr. 440, 428 P.2d 304, and in its comparison of Mitchell v. Superior Court (1958) 50 Cal.2d 827, 330 P.2d 48 and Priestly v. Superior Court (1958) 50 Cal.2d 812, 330 P.2d 39.
The question before us in Jennings was whether a magistrate's erroneous restriction of a defendant's exercise of his or her right of cross-examination at a preliminary examination amounted to denial of a substantial right affecting the legality of the commitment. In resolving this question, we drew a distinction between Priestly and Mitchell.
The opinion in Jennings implied there had been a denial of a substantial right affecting the legality of the commitment in Priestly: "[T]he sole incriminating evidence introduced at the preliminary hearing was obtained in the course of an arrest and search conducted without a warrant but on the basis of information received from confidential informants. The magistrate denied the defendant's motion to disclose the informants' identities or to strike the arresting officers' testimony. We [held] ... that `When the prosecution relies ... on communications from an informer to show reasonable cause and has itself elicited testimony as to those communications on direct examination, it is essential to a fair trial that the defendant have the right to cross-examine as to the source of those communications.'" (Jennings v. Superior Court, supra, 66 Cal.2d at p. 878, 59 Cal.Rptr. 440, 428 P.2d 304, fn. omitted.)
We stated in Jennings that, by contrast, there had been no denial of a substantial right affecting the legality of the commitment in Mitchell: "[T]he incriminating evidence was only partially the product of communications from confidential informants, and the defendants did not contend there was no competent evidence of reasonable cause. In those circumstances we reasoned [citation]: `It is contended, however, that denial of the right of cross-examination at the preliminary hearing is not only a ruling on the admissibility of evidence but the denial of a constitutional right. It is unnecessary to resolve this contention, for there was not such an interference with the right of cross-examination in this case as to justify [relief]. It does not appear that disclosure of the names of the informers was demanded to enable defendants to discredit the prosecution's evidence at the preliminary hearing or that they wished to use the informers as witnesses at that hearing.' Indeed, the defendants admittedly did not intend to present an affirmative defense at the preliminary hearing, and desired the names of the informants solely as an aid in preparing for the ensuing trial." (Jennings v. Superior Court, supra, 66 Cal.2d at pp. 878-879, 59 Cal.Rptr. 440, 428 P.2d 304.)
In Jennings, we proceeded to declare that the "lesson" of Priestly and Mitchell was "clear": "As summarized by Justice Carter in his concurring opinion in Priestly [citation], `Not [in] every instance in which a cross-examiner's question is disallowed will defendant's right to a fair hearing be abridged, since the matter may be too unimportant [citation], or there may be no prejudice [citation], or the question may *322 involve issues which can be brought up at a more appropriate time [citation]. However, where the subject of cross-examination concerns the matter at issue there can be no doubt that the refusal to permit such question results in a denial of a fair hearing.'" (Jennings v. Superior Court, supra, 66 Cal.2d at p. 879, 59 Cal.Rptr. 440, 428 P.2d 304.)
We applied that "lesson" in Jennings to the facts presented, concluding that the defendant in that case was denied a substantial right affecting the legality of the commitment: "Here, in contrast to Mitchell, [the defendant] did intend to present an affirmative defense at the preliminary hearing; [and] he did desire to cross-examine on the excluded subjects for the purpose of discrediting the prosecution's evidence and developing his defense at that hearing.... It follows that on the facts of this case ... the restriction on cross-examination amounted to a denial of [the defendant's] `substantial rights' in the preliminary hearing proceedings...." (Jennings v. Superior Court, supra, 66 Cal.2d at pp. 879-880, 59 Cal.Rptr. 440, 428 P.2d 304.)
We apply the lesson of Jennings more generally here to hold that a defendant is denied a substantial right affecting the legality of the commitment when he or she is subjected to prejudicial error, that is, error that reasonably might have affected the outcome (see Currie v. Superior Court (1991) 230 Cal.App.3d 83, 98-101, 281 Cal.Rptr. 250). The conclusion we reach is consistent with the results reached in reported decisions in this area of the law, including of course Priestly and Mitchell as well as Jennings, from which our holding derives. The decision we reach also is in accord with judicial practice in other areas of the law where, as in the context of plain error rules, a defendant is deemed to be denied a substantial right by exposure to prejudicial error. (See, e.g., Chapman v. California (1967) 386 U.S. 18, 21-22, 87 S.Ct. 824, 17 L.Ed.2d 705; People v. Arredondo (1975) 52 Cal.App.3d 973, 978, 125 Cal.Rptr. 419.)
It follows that a magistrate denies a defendant a substantial right affecting the legality of the commitment by erroneously and prejudicially failing to consider whether to dismiss a complaint in furtherance of justice under section 1385. Recent decisions teach that error in this context is prejudicial when the magistrate does not "`"clearly indicate[ ]"' an unwillingness" to order dismissal on that basis. (People v. Smith (1997) 59 Cal.App.4th 46, 50, 68 Cal.Rptr.2d 732.)[10]
*323 It is manifest that the magistrate denied defendants a substantial right affecting the legality of the commitment by erroneously and prejudicially failing to consider whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case.
On independent review (see, e.g., People v. Jones (1998) 17 Cal.4th 279, 301, 70 Cal.Rptr.2d 793, 949 P.2d 890; People v. Laiwa (1983) 34 Cal.3d 711, 718, 195 Cal.Rptr. 503, 669 P.2d 1278)  and in view of the apparently unusual circumstances here disclosed, in which the magistrate expressed a strong desire to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case  we conclude that Judge Wellington properly set aside the information under section 995.
The magistrate's error is evident, for, as Judge Wellington concluded, the magistrate incorrectly believed himself precluded from dismissing the complaint in furtherance of justice under section 1385 in light of the particular facts of the case.[11] The basis of the magistrate's incorrect belief is less clear, but proves to be of no consequence.
As noted, Judge Wellington concluded that in ordering reinstatement of the complaint under section 871.5, Judge Shore did not preclude the magistrate from considering, at the resumed preliminary examination, whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case, but at most precluded him from exercising such power in reliance on a view of the law found to be incorrect. If this conclusion by Judge Wellington is sound, the magistrate's belief that he was precluded from ordering dismissal, based on the facts presented, plainly was incorrect inasmuch as Judge Shore did not purport to preclude the magistrate from doing so.
As also noted, Judge Wellington concluded that if Judge Shore, in ordering reinstatement of the complaint under section 871.5, had precluded the magistrate from considering, at the resumed preliminary examination, whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case, Judge Shore would have erred by going beyond the grounds on which the magistrate rested his dismissal, which was a view of the law found to be incorrect. If this conclusion by Judge Wellington is sound, the magistrate's belief that he was precluded from ordering dismissal based on the facts presented was incorrect, because *324 Judge Shore did not possess the authority to preclude the magistrate from doing so. Judge Shore was required to "determine the motion [to reinstate the complaint] on the basis of the record of the proceedings before the magistrate" (§ 871.5, subd.(c)) and with respect to the ground on  which the magistrate rested his decision (see People v. Childs (1991) 226 Cal.App.3d 1397, 1406, 277 Cal.Rptr. 456; Chism v. Superior Court (1981) 123 Cal.App.3d 1053, 1061, 176 Cal.Rptr. 909). Judge Shore's "role" therefore was "limited." (In re Torres, supra, 128 Cal.App.3d at p. 829, 180 Cal.Rptr. 700; see Chism v. Superior Court, supra, 123 Cal.App.3d at p. 1060, 176 Cal.Rptr. 909.) Judge Shore did not possess the authority to usurp the function of the magistrate (see In re Torres, supra, 128 Cal.App.3d at p. 829, 180 Cal.Rptr. 700; Chism v. Superior Court, supra, 123 Cal.App.3d at p. 1060, 176 Cal.Rptr. 909), specifically, the magistrate's consideration whether to order dismissal based on the facts presented.
Relying on People v. Draper (1996) 42 Cal.App.4th 1627, 50 Cal.Rptr.2d 335, and People v. Childs, supra, 226 Cal.App.3d 1397, 277 Cal.Rptr. 456, the People argue that by compelling the magistrate to reinstate the complaint under section 871.5, Judge Shore necessarily ordered the magistrate to resume the preliminary examination where he had terminated it and thereby precluded him from deciding any issue that he could have decided and from revisiting any issue that he had decided prior to that time, in order to prevent defendants from obtaining a "second bite of the apple." Given a reasonable reading, however, Draper and Childs each stand only for the unremarkable proposition that a magistrate must comply with an order compelling reinstatement of the complaint. (See People v. Draper, supra, 42 Cal.App.4th at pp. 1631-1634, 50 Cal.Rptr.2d 335; People v. Childs, supra, 226 Cal.App.3d at pp. 1407-1411, 277 Cal.Rptr. 456.) To be sure, there is language in Draper suggesting that the magistrate may not decide any issue that he or she addressed but failed to decide. (See People v. Draper, supra, 42 Cal.App.4th at p. 1632 & fns. 5 & 6, 50 Cal.Rptr.2d 335.) But at the initial preliminary examination, the magistrate simply did not address the issue whether to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case. And because he did not do so, defendants were not attempting to obtain a second bite of the apple at the resumed preliminary examination, but only the first.
Just as evident as the magistrate's error is its prejudicial character. As stated, the erroneous failure by a magistrate to consider whether to dismiss a complaint in furtherance of justice under section 1385 is prejudicial when the magistrate does not clearly indicate an unwillingness to order dismissal on that basis. Notably, the magistrate here expressed a strong desire to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case, stating in response to defendants' invitation: "I would dearly love to accept your invitation because I still believe that justice in this community is being subverted to a certain extent, if not totally, in the facts of this case."
In sum, we disagree with the Court of Appeal and conclude that the superior court may set aside an information under section 995 when the magistrate erroneously and prejudicially failed to consider whether to dismiss a complaint in furtherance of justice under section 1385, and thereby denied the defendant a substantial right affecting the legality of the commitment. We further conclude that in the *325 present case Judge Wellington properly set aside the information.[12]

III
For the reasons stated above, we reverse the judgment of the Court of Appeal and remand the cause to the Court of Appeal with directions to affirm the order of the superior court setting aside the information under section 995.
WE CONCUR: KENNARD, BAXTER, WERDEGAR, CHIN, BROWN and MORENO, JJ.
NOTES
[1]  All unspecified section references are to the Penal Code.
[2]  The magistrate subsequently clarified that the "comment" quoted in the text "was not directed at any one individual and was not intended to suggest or imply that the district attorney, personally, was subverting justice."
[3]  Section 871.5 provides in its entirety:

"(a) When an action is dismissed by a magistrate pursuant to Section 859b, 861, 871, 1008, 1381, 1381.5, 1385, 1387, or 1389 of this code or Section 41403 of the Vehicle Code, or a portion thereof is dismissed pursuant to those same sections which may not be charged by information under Section 739, the prosecutor may make a motion in the superior court within 15 days to compel the magistrate to reinstate the complaint or a portion thereof and to reinstate the custodial status of the defendant under the same terms and conditions as when the defendant last appeared before the magistrate.
"(b) Notice of the motion shall be made to the defendant and the magistrate. The only ground for the motion shall be that, as a matter of law, the magistrate erroneously dismissed the action or a portion thereof.
"(c) The superior court shall hear and determine the motion on the basis of the record of the proceedings before the magistrate. If the motion is litigated to decision by the prosecutor, the prosecution is prohibited from refiling the dismissed action, or portion thereof.
"(d) Within 10 days after the magistrate has dismissed the action or a portion thereof, the prosecuting attorney may file a written request for a transcript of the proceedings with the clerk of the magistrate. The reporter shall immediately transcribe his or her shorthand notes pursuant to Section 869 and file with the clerk of the superior court an original plus one copy, and as many copies as there are defendants (other than a fictitious defendant). The reporter shall be entitled to compensation in accordance with Section 869. The clerk of the superior court shall deliver a copy of the transcript to the prosecuting attorney immediately upon its receipt and shall deliver a copy of the transcript to each defendant (other than a fictitious defendant) upon his or her demand without cost.
"(e) When a court has ordered the resumption of proceedings before the magistrate, the magistrate shall resume the proceedings and when so ordered, issue an order of commitment for the reinstated offense or offenses within 10 days after the superior court has entered an order to that effect or within 10 days after the remittitur is filed in the superior court. Upon receipt of the remittitur, the superior court shall forward a copy to the magistrate.
"(f) Pursuant to paragraph (9) of subdivision (a) of Section 1238 the people may take an appeal from the denial of the motion by the superior court to reinstate the complaint or a portion thereof. If the motion to reinstate the complaint is granted, the defendant may seek review thereof only pursuant to Sections 995 and 999a. That review may only be sought in the event the defendant is held to answer pursuant to Section 872.
"(g) Nothing contained herein shall preclude a magistrate, upon the resumption of proceedings, from considering a motion made pursuant to Section 1318.
"If the superior court grants the motion for reinstatement and orders the magistrate to issue an order of commitment, the defendant, in lieu of resumed proceedings before the magistrate, may elect to waive his or her right to be committed by a magistrate, and consent to the filing of an amended or initial information containing the reinstated charge or charges. After arraignment thereon, he or she may adopt as a motion pursuant to Section 995, the record and proceedings of the motion taken pursuant to this section and the order issued pursuant thereto, and may seek review of the order in the manner prescribed in Section 999a."
Both the People and defendants Toosley and Rohrer have requested that we take judicial notice of various legislative materials relating to the enactment of section 871.5 as it read in an earlier but substantially similar form. The People also have requested that we take judicial notice of a minute order relating to defendant Rogers's preliminary examination and the magistrate's order dismissing the complaint as to Rogers for insufficiency of the evidence to establish probable cause to believe that he was guilty of any of the charged sales of marijuana. No opposition has been filed to any of these requests. We therefore grant the requests. (See Evid.Code, §§ 452, subds. (c) & (d), 459, subd. (a).)
[4]  Section 995 provides in its entirety:

"(a) Subject to subdivision (b) of Section 995a, the indictment or information shall be set aside by the court in which the defendant is arraigned, upon his or her motion, in either of the following cases:
"(1) If it is an indictment:
"(A) Where it is not found, endorsed, and presented as prescribed in this code.
"(B) That the defendant has been indicted without reasonable or probable cause.
"(2) If it is an information:
"(A) That before the filing thereof the defendant had not been legally committed by a magistrate.
"(B) That the defendant had been committed without reasonable or probable cause.
"(b) In cases in which the procedure set out in subdivision (b) of Section 995a is utilized, the court shall reserve a final ruling on the motion until those procedures have been completed."
[5]  Section 4 of article VI of the California Constitution provides in its entirety:

"In each county there is a superior court of one or more judges. The Legislature shall prescribe the number of judges and provide for the officers and employees of each superior court. If the governing body of each affected county concurs, the Legislature may provide that one or more judges serve more than one superior court.
"In each superior court there is an appellate division. The Chief Justice shall assign judges to the appellate division for specified terms pursuant to rules, not inconsistent with statute, adopted by the Judicial Council to promote the independence of the appellate division."
[6]  Section 11 of article VI of the California Constitution provides in its entirety:

"(a) The Supreme Court has appellate jurisdiction when judgment of death has been pronounced. With that exception courts of appeal have appellate jurisdiction when superior courts have original jurisdiction in causes of a type within the appellate jurisdiction of the courts of appeal on June 30, 1995, and in other causes prescribed by statute. When appellate jurisdiction in civil causes is determined by the amount in controversy, the Legislature may change the appellate jurisdiction of the courts of appeal by changing the jurisdictional amount in controversy.
"(b) Except as provided in subdivision (a), the appellate division of the superior court has appellate jurisdiction in causes prescribed by statute.
"(c) The Legislature may permit courts exercising appellate jurisdiction to take evidence and make findings of fact when jury trial is waived or not a matter of right."
[7]  The Court of Appeal asserted that even if defendants could not have obtained review of Judge Shore's order compelling the magistrate to reinstate the complaint under section 871.5 by a motion to set aside the information under section 995, they "were not without a remedy; they could have sought relief by moving for a writ of prohibition ... before the appellate court." But as Los Angeles Chemical makes clear (see Los Angeles Chemical, supra, 226 Cal.App.3d at pp. 709 711, 276 Cal.Rptr. 647), defendants could have submitted a petition for writ of prohibition seeking review of the reinstatement order only if they first had moved under section 995 to set aside the information on that basis (see § 871.5, subd. (f)).
[8]  Section 1385 provides in its entirety:

"(a) The judge or magistrate may, either of his or her own motion or upon the application of the prosecuting attorney, and in furtherance of justice, order an action to be dismissed. The reasons for the dismissal must be set forth in an order entered upon the minutes. No dismissal shall be made for any cause which would be ground of demurrer to the accusatory pleading.
"(b) This section does not authorize a judge to strike any prior conviction of a serious felony for purposes of enhancement of a sentence under Section 667.
"(c)(1) If the court has the authority pursuant to subdivision (a) to strike or dismiss an enhancement, the court may instead strike the additional punishment for that enhancement in the furtherance of justice in compliance with subdivision (a).
"(2) This subdivision does not authorize the court to strike the additional punishment for any enhancement that cannot be stricken or dismissed pursuant to subdivision (a)."
[9]  See, e.g., Jennings v. Superior Court (1967) 66 Cal.2d 867, 59 Cal.Rptr. 440, 428 P.2d 304; People v. Elliot (1960) 54 Cal.2d 498, 6 Cal.Rptr. 753, 354 P.2d 225, overruled on another point in People v. Pompa Ortiz, supra, 27 Cal.3d at page 529, 165 Cal.Rptr. 851, 612 P.2d 941; People v. Napthaly (1895) 105 Cal. 641, 39 P. 29; People v. Phillips (1964) 229 Cal.App.2d 496, 40 Cal.Rptr. 403; People v. Hellum (1962) 205 Cal.App.2d 150, 22 Cal.Rptr. 724; People v. Bucher (1959) 175 Cal.App.2d 343, 346 P.2d 202; McCarthy v. Superior Court (1958) 162 Cal.App.2d 755, 328 P.2d 819; People v. Williams (1954) 124 Cal.App.2d 32, 268 P.2d 156; and People v. Salas (1926) 80 Cal.App. 318, 250 P. 526.
[10]  Smith quoted People v. Allen (1997) 53 Cal.App.4th 1127, 1136, 62 Cal.Rptr.2d 274, disapproved on another point in People v. Fuhrman (1997) 16 Cal.4th 930, 947, footnote 11, 67 Cal.Rptr.2d 1, 941 P.2d 1189, with Allen in turn quoting People v. Superior Court (Romero) (1996) 13 Cal.4th 497, 530, footnote 13, 53 Cal.Rptr.2d 789, 917 P.2d 628; see People v. Meloney (2003) 30 Cal.4th 1145, 1165, 135 Cal.Rptr.2d 602, 70 P.3d 1023; People v. Vong (1997) 58 Cal.App.4th 1063, 1065-1068, 68 Cal.Rptr.2d 436.

We conclude that any implication in Jackson v. Superior Court (1982) 135 Cal.App.3d 767, 185 Cal.Rptr. 766, suggesting that a magistrate's failure to consider whether to dismiss a complaint in furtherance of justice under section 1385 cannot deny a defendant a substantial right affecting the legality of the commitment must be disapproved. In Jackson, the Court of Appeal addressed the question "whether a defendant is `illegally committed' by [a] magistrate within the meaning of ... section 995 when he is denied the opportunity to present testimony" at a preliminary examination, in support of a "nonstatutory motion to dismiss [the complaint] for prearrest delay," "concerning the prejudice caused by [such] delay." (Jackson v. Superior Court, supra, 135 Cal.App.3d at p. 769, 185 Cal.Rptr. 766.) The Court of Appeal gave a negative answer, concluding that such "testimony ... is not integral to the preliminary examination. A defendant prevented from litigating the issue before the magistrate is not `illegally committed.'" (Ibid.) In the course of its discussion, the Court of Appeal implied that a magistrate's erroneous failure to consider whether to order dismissal could not deny a defendant a substantial right affecting the legality of the commitment. (See id. at pp. 770-772, 185 Cal.Rptr. 766.) So far as it goes, the Court of Appeal's implication is sound: to deny a defendant a substantial right affecting the legality of the commitment, as we have explained, the magistrate's failure must be prejudicial as well as erroneous. But to the extent the Court of Appeal's implication might be read to suggest that the magistrate's failure cannot deny a defendant a substantial right affecting the legality of the commitment even when the failure is prejudicial as well as erroneous, the appellate court's opinion is unsound under the analysis set out above and is hereby disapproved.
[11]  Of course, a magistrate cannot be deemed to have erroneously failed to consider whether to dismiss a complaint in furtherance of justice under section 1385 on a silent record, for it is the "general rule" that the magistrate "is presumed to have applied the law correctly in the absence of a clear indication to the contrary." (People v. Fuhrman, supra, 16 Cal.4th at p. 944, 67 Cal.Rptr.2d 1, 941 P.2d 1189.) Here, as is evident, the record is far from silent concerning whether the magistrate committed error.
[12]  The Court of Appeal asserted that the magistrate was not authorized to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case or, if he was authorized to do so, already had exercised such authority and could not exercise it again. But there is no basis for concluding that only the superior court is authorized to order dismissal on that basis, or that the superior court is authorized to do so only at the time of sentencing. Indeed, dismissal by a magistrate in furtherance of justice is permitted broadly under a variety of circumstances and for a variety of reasons. (See People v. Hatch (2000) 22 Cal.4th 260, 273, 92 Cal.Rptr.2d 80, 991 P.2d 165.)

The Court of Appeal also asserted that the magistrate had exhausted any authority that he may have possessed to dismiss the complaint in furtherance of justice under section 1385 in light of the particular facts of the case. As Judge Wellington concluded, and as Judge Shore did not dispute, the magistrate did not dismiss the complaint, at the initial preliminary examination, in furtherance of justice under section 1385 in light of the particular facts of the case. Although Judge Shore was of the view that the magistrate ordered dismissal in furtherance of justice under section 1385, and Judge Wellington was of the differing view that the magistrate ordered dismissal under section 871 for the absence of evidence of a sale of marijuana as proscribed by a valid statute, both Judge Shore and Judge Wellington agreed that the magistrate ordered dismissal based on his conclusion that in light of Proposition 215, Health and Safety Code section 11360 was invalid as to sales to qualified patients and primary caregivers under the Fourteenth Amendment's due process and equal protection clauses. The "rulings" that Judge Shore would not allow the magistrate to "find ways to get around" were determinations of law, particularly Judge Shore's determination that Health and Safety Code section 11360 was not invalid.
