
128 Cal.App.3d 992 (1982)
180 Cal. Rptr. 742
WILLIAM JOHN VLICK et al., Petitioners,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. 63172.
Court of Appeals of California, Second District, Division One.
February 22, 1982.
*994 COUNSEL
Arthur Lewis and Kenneth H. Lewis for Petitioners.
No appearance for Respondent.
John K. Van de Kamp, District Attorney, Donald J. Kaplan and Maurice H. Oppenheim, Deputy District Attorneys, for Real Party in Interest.
OPINION
LILLIE, J.
Following denial of their motion under Penal Code section 995 to dismiss an information charging them with three counts of receiving stolen property (§ 496, Pen. Code) and one count of possession for sale of heroin (§ 11351, Health & Saf. Code), defendants Vlick and McKee filed the within petition for writ of prohibition pursuant to section 999a, Penal Code on the ground the superior court previously had exceeded its jurisdiction by hearing the People's motion under section 871.5, Penal Code, reviewing the magistrate's ruling granting a motion *995 to suppress (§ 1538.5, Pen. Code) and reinstating the complaint after it had been dismissed by the magistrate. Thereafter this court issued alternative writ of prohibition.
Petitioners were arraigned on a felony complaint in the municipal court on July 9, 1980. The parties stipulated that a hearing pursuant to section 1538.5 on petitioners' motion to quash two search warrants be heard prior to the preliminary hearing. After several delays the motion was heard by Judge Newman on November 14, 1980. No testimony was taken; petitioners' counsel submitted the cause on the documents arguing "the insufficiency of the affidavit on its face" to support the search warrant. Judge Newman read and considered the search warrants, heard oral argument and granted the motion holding as a matter of law that the affidavits did not establish probable cause to support issuance of the warrants. Preliminary hearing was set for January 20, 1981. However, on that day no preliminary hearing was held  no testimony was taken and no proof was offered. Counsel for petitioners told Judge Nelson that "motion to quash the search warrant was granted" and it had been stipulated "that the entire case and all the evidence that had been obtained in this matter was obtained as a result of the search warrant in question"; and the prosecutor advised him he was unable to proceed with the preliminary hearing whereupon Judge Nelson dismissed the complaint pursuant to section 871, Penal Code.
On the same day (Jan. 20, 1981), the People filed a motion pursuant to section 871.5, Penal Code[1] for a review of the magistrate's ruling quashing the search warrant and dismissing the complaint in the superior *996 court. Judge Leetham held that he had jurisdiction on the motion to review the magistrate's rulings and, after reviewing the transcript of proceedings before the magistrate and hearing oral argument, reversed the dismissal and order quashing the search warrants, reinstated the complaint and remanded the cause to the magistrate for a preliminary hearing. The preliminary hearing was had before Judge Cherniss on May 6, 1981; motion to suppress pursuant to section 1538.5 was heard and denied, and petitioners were held to answer. Thereafter in the superior court petitioners moved under section 995, Penal Code to dismiss the information on the ground the superior court (Judge Leetham) had no jurisdiction to hear the motion under section 871.5, Penal Code. The motion was denied by Judge Kakita. This petition followed. (1a) The issue framed by petitioners is whether under section 871.5, Penal Code the superior court has the authority to review a ruling of a magistrate granting a motion filed pursuant to section 1538.5, Penal Code. Their contention is that section 1538.5 provides an exclusive and comprehensive remedy.
Section 871.5, Penal Code provides that upon dismissal of a complaint by a magistrate under section 859b, 861, 871 or 1385, the People may move the superior court to compel the magistrate to reinstate their complaint and reinstate the custodial status of defendant, "on the ground that, as a matter of law, the magistrate erroneously dismissed the action." The motion shall be heard and determined on the basis of the record of the proceedings before the magistrate. If the motion is litigated to decision by the People, they are prohibited from refiling the action.
Section 1538.5, subdivision (j), Penal Code provides in pertinent part: "If the property or evidence relates to a felony offense initiated by complaint and the defendant's motion for the return of the property or suppression of the evidence at the preliminary hearing is granted, and if the defendant is not held to answer at the preliminary hearing, the People may file a new complaint or seek an indictment after the preliminary hearing, and the ruling at the prior hearing shall not be binding in any subsequent proceeding."
The legislative history of Assembly Bill No. 2383 (AB 2383), of which section 871.5, Penal Code is a part, reflects the clear intent of the Legislature and the purpose of the statute. (See Landrum v. Superior *997 Court (1981) 30 Cal.3d 1, 12 [177 Cal. Rptr. 325, 634 P.2d 352]; Rockwell v. Superior Court (1976) 18 Cal.3d 420, 442 [134 Cal. Rptr. 650, 556 P.2d 1101].) Enacted in 1980, AB 2383, which among other things added section 871.5 to the Penal Code, had its genesis in a 1978 decision of the California Supreme Court of People v. Peters (1978) 21 Cal.3d 749 [147 Cal. Rptr. 646, 581 P.2d 651] (overruled in Landrum v. Superior Court (1981) 30 Cal.3d 1 [177 Cal. Rptr. 325, 634 P.2d 352]) holding that a magistrate had no authority to dismiss a felony complaint under section 1385, Penal Code. At the time the magistrate had no power to dismiss a felony complaint under any statute including section 1538.5, Penal Code (enacted in 1967); section 871, Penal Code only authorized the magistrate to discharge a defendant. This permitted the prosecutor to extend a defendant's period of potential liability by repeated filings. Abuse of this practice well could subject an accused to harassment and prosecutorial forum shopping. In 1978 the Legislature endeavored to remedy this situation by enacting Senate Bill No. 1474 which was vetoed by the Governor because it "failed to give the prosecutors the same right to appeal the dismissal of a criminal case by a magistrate as prosecutors already possess with respect to the dismissal of such a case by a superior court judge."
In 1980 the Legislature enacted AB 2383 effective January 1, 1981. The bill added section 871.5 to the Penal Code and amended sections 859b, 861, 871, 1238, 1384, 1385 and 1387. Section 871.5 was enacted to decrease the number of refilings of felony complaints when the dismissal by a magistrate was based upon a legal rather than a factual ruling. If the magistrate ruled as a matter of law, the order of dismissal could be reviewed in the superior court on motion by the People on the record of the proceedings before the magistrate; a ruling adverse to the People on this motion could be appealed to the Court of Appeal but if they litigated the motion to decision they were prohibited from refiling the action. Petitioners argue that in enacting AB 2383 the Legislature did not amend section 1538.5, Penal Code, which failure must be construed to preclude the People from using section 871.5, Penal Code to seek review by the superior court of an adverse section 1538.5 ruling; and that section 1538.5 provides an exclusive remedy.[2] On the other *998 hand, neither did the Legislature exclude from the ambit of section 871.5, Penal Code a superior court review of an erroneous dismissal of a felony complaint based upon a section 1538.5 ruling as a matter of law.
We do not perceive the issue here, as framed by petitioners, to be whether or not section 871.5, Penal Code can be used by the People to review an adverse section 1538.5 ruling by a magistrate. The real issue is whether section 871.5 was intended by the Legislature to be used by the People for a superior court review of an erroneous dismissal by a magistrate arising out of the magistrate's ruling as a matter of law on any motion. A reasonable commonsense construction of section 871.5 with reference to the whole system of criminal law of which it is a part (Landrum v. Superior Court, 30 Cal.3d 1, 14 [177 Cal. Rptr. 325, 634 P.2d 352]) in accordance with the clear purpose of the statute and intent of the lawmakers (Pitney-Bowes, Inc. v. State of California (1980) 108 Cal. App.3d 307, 313-314 [166 Cal. Rptr. 489]), leads us to the conclusion that it was.
First, the addition of section 871.5 to the Penal Code by AB 2383 in 1980 has special significance because it reflects legislative consideration of a comprehensive method of disposing of issues of law upon which a magistrate's dismissal of a felony complaint is based which when used by the People precludes them from refiling. The element of finality built into this statutory procedure was intended as a protection to the defendant, and advances the stated purpose of AB 2383 to decrease the number of refiled felony complaints not only by authorizing the magistrate to dismiss a felony complaint but by allowing him to order a dismissal that serves as an effective bar to further prosecution. (See Legislative Analysis, AB 2383.) Having thus limited the People's action in this regard the Legislature devised a method by which they could obtain speedy review by the superior court of a dismissal by the magistrate based upon a legal ruling. Second, the language of section 871.5, Penal Code does not specify the kind of magistrate's dismissal to be reviewed by the superior court or how the dismissal must come about or the kind of motion that must give rise to the legal ruling on which the order of dismissal is based; the only limitation on review is the ground upon which the People's challenge must be based, i.e., "as a matter of law, the magistrate erroneously dismissed the action...." (§ 871.5, Pen. Code.) Third, petitioners complain that since the People wish to circumvent section 1538.5, subdivision (j) "and add a right to *999 appeal the granting of a motion to suppress by the magistrate," they are seeking three chances to have a defendant bound over for trial which is a clear conflict with the intent of section 1387. Real party in interest counters with the suggestion that section 1538.5 allows the People an option to proceed thereunder by refiling a complaint or to proceed under section 871.5 for a speedy determination of an issue at law but which results in the finality of the dismissal if the motion is litigated to decision by the People. In the context of this case we do not decide whether such option exists when a dismissal is based on an order granting a section 1538.5 motion "as a matter of law." Our only concern on this petition is whether under such circumstances the People may challenge the order of dismissal by motion made under section 871.5.
We conclude that dismissal of a complaint by a magistrate based upon a ruling on legal grounds on any motion properly before and decided by the magistrate is subject to review by the superior court on motion by the People on the ground that, "as a matter of law, the magistrate erroneously dismissed the action," and that this procedure is consistent with and in furtherance of the stated purpose of AB 2383 and the intent of the Legislature in enacting it. Having allowed the magistrate to dismiss a felony complaint which dismissal serves as an effective bar to further prosecution, the Legislature provided a means by which the People could obtain immediate review of a magistrate's dismissal if it was based on an issue of law decided by him in ruling on any motion properly before him. This procedure is fair to both the defendant and the People in that defendant is relieved from repeated filings and the People are afforded an avenue for overturning the magistrate's dismissals erroneous as a matter of law.
As to the instant case, there can be little question that the dismissal by Judge Nelson was based solely on a statement by the prosecutor that he could not proceed with the preliminary hearing based upon the legal ruling by Judge Newman granting the section 1538.5 motion depriving him of sufficient evidence to establish probable cause. While the ruling and the dismissal were made by two different magistrates it is only reasonable to construe the orders as having been made at one time by the same magistrate.[3] By implication Judge Leethan ruled that the complaint *1000 had been erroneously dismissed by the magistrate as a matter of law, and we agree, even though he may have been in error in finding that the decision by Judge Newman was "premature to say the least."[4]
That the section 1538.5 motion was decided "as a matter of law" is established by the record of the proceedings before the magistrate. No hearing was had in the sense that any testimony was taken; no factual issues were before the magistrate and none were decided by him. The motion was submitted on the documents (search warrants) before him; as to each warrant the sole issue, as posited by petitioners' counsel, was the sufficiency of the affidavit on its face to support the warrant. The magistrate read and considered the search warrants and heard oral argument, and on the four corners of the documents granted the motion ruling as a matter of law that the affidavits did not establish probable cause to support issuance of the search warrants. It was solely on the basis of this legal ruling that the second magistrate, Judge Nelson, dismissed the complaint. No preliminary hearing was had, in fact, the prosecutor stated he was unable to and did not proceed with the preliminary hearing, and there was no factual issue before the magistrate and no factual determination by him because no evidence was offered. The magistrate dismissed the complaint, not on any finding or ruling he made but because the prosecutor advised he could not proceed with the preliminary hearing because of the legal ruling granting the motion to quash. Thus, if the magistrate was in error as a matter of law in granting the motion to quash, the action was erroneously dismissed.
(2) Without merit is the contention that to permit, in the instant case, the use by the People of section 871.5 constitutes the application *1001 of an ex post facto law. A statute has ex post facto effect when it alters the situation of an accused to his disadvantage. The doctrine does not apply to trivial matters but to some vested and substantial right possessed at the time of the offense. Nor does it apply to purely procedural change. (People v. Sobiek (1973) 30 Cal. App.3d 458, 472-473 [106 Cal. Rptr. 519, 82 A.L.R.3d 804].) We do not perceive any denial to petitioners of a vested right under AB 2383, in fact, they previously faced repeated refilings by the People and are now protected against them; and the statute does not affect them in a harsh or arbitrary manner for petitioners still have their remedy to test the section 1538.5 ruling in the superior court.[5]
(1b) In urging that the Legislature would have amended section 1538.5 if the Legislature intended review of a suppression motion under section 871.5, we note that the dissent relies upon the 1970 amendment to section 1238 but ignores AB 2383's amendment to section 1238 which gives the People the right to appeal from an order denying a section 871.5 motion by the superior court. Thus, it is apparent that the Legislature in AB 2383, contrary to the assertion in the dissent, not only intended to give the People an opportunity to review a dismissal by a magistrate pursuant to section 871 but also determined that such piecemeal disposition is appropriate. Given the scheme of pretrial review and appeal in AB 2383 and the Governor's concern over the predecessor bill to AB 2383, we cannot conclude that the Legislature intended to give the People an avenue of review of the magistrate's dismissal but also intended that such avenue of review would not be on the merits even if the grounds for a section 871.5 motion were satisfied.
The alternative writ of prohibition is discharged and petition for writ of prohibition is denied.
Hanson (Thaxton), J., concurred.
SPENCER, P.J.
I respectfully dissent. It is well established that a statute should be construed with reference to the whole system of law of *1002 which it is a part in order to harmonize and give effect to the entirety. (State Compensation Ins. Fund v. Workers' Comp. Appeals Bd. (1979) 88 Cal. App.3d 43, 53 [152 Cal. Rptr. 153]; Tidewater Oil Co. v. Workers' Comp. Appeals Bd. (1977) 67 Cal. App.3d 950, 956 [137 Cal. Rptr. 36].) Accordingly, this court should look to the entire body of law dealing with dismissals and rights of appeal  not only those Penal Code sections enacted and amended per Assembly Bill No. 2383, but the interrelation of those sections with section 1538.5.
Penal Code section 1538.5 was originally enacted in 1967. (Stats. 1967, ch. 1537, § 1, p. 3652.) Subdivision (m) provides that, "[t]he proceedings provided for in this section, Section 995, Section 1238, and Section 1466 shall constitute the sole and exclusive remedies prior to conviction to test the unreasonableness of a search or seizure...." No subdivision of section 1538.5 gives the People a right to appeal a magistrate's order suppressing evidence. Instead, subdivision (j) states that if the defendant thereafter is not held to answer, "the people may file a new complaint or seek an indictment after the preliminary hearing, and the ruling at the prior hearing shall not be binding in any subsequent proceeding...." In contrast, subdivision (j) grants the People the right to appeal an order granting a suppression motion in a misdemeanor matter and subdivision (l) permits appeal pursuant to section 1238 from a dismissal under section 1385 following the granting of a motion to suppress at a special hearing in the superior court. These subdivisions remain unchanged since the original enactment of section 1538.5.
Simultaneously with the enactment of section 1538.5, the Legislature added subdivision (a) 7 to section 1238 (Stats. 1967, ch. 1537, § 3, p. 3657), which accorded the People the right to appeal "[f]rom an order dismissing a case prior to trial made upon motion of the court pursuant to Section 1385 whenever such order is based upon an order granting defendant's motion to ... suppress property or evidence made at a special hearing as provided in this code." In 1970, the Legislature added subdivision (c) to section 1238 (Stats. 1970, ch. 1289, § 1, p. 2380), providing that, in the above circumstances, "the court may review the order granting defendant's motion to ... suppress evidence...."; thus reinforcing the exclusivity of section 1538.5.
Thereafter, Cash v. Superior Court (1973) 35 Cal. App.3d 226 [110 Cal. Rptr. 612] affirmed the exclusive operation of section 1538.5, holding *1003 that the People could not circumvent the limitations of section 1538.5 by invoking section 1466 to seek review of a magistrate's order granting a defendant's suppression motion in the appellate department of the superior court. (Id., at p. 232; see also People v. Belknap (1974) 41 Cal. App.3d 1019, 1025 [116 Cal. Rptr. 664]; People v. Randall (1973) 35 Cal. App.3d 972, 977 [111 Cal. Rptr. 590].) The Cash court recognized the multiple-appeal effect of permitting the People to appeal a magistrate's suppression order, an effect which remains operative today. If a magistrate denies a suppression motion in a felony matter, the defendant may renew the motion at a special hearing in the superior court (§ 1538.5, subd. (i)); therefore, were the People to be accorded the right to appeal to the superior court an order granting the motion, either under section 871.5 or section 1466, a decision overruling the order of the magistrate would be effectively nullified in any instance where the defendant invoked subdivision (i). (35 Cal. App.3d at p. 230.) Hence Cash concluded that "[i]n the absence of express statutory authority, ... the Legislature did not intend to twice give the People the benefit of appellate review of a pretrial motion in the same case. We think the Legislature recognized that piecemeal disposition and multiple appeals in a single action would be wasteful of judicial time as well as costly and oppressive to a defendant." (Id., at p. 231.)
The Legislature is presumed to have knowledge of existing judicial decisions and to have amended and enacted statutes in light thereof. (Estate of McDill (1975) 14 Cal.3d 831, 839 [122 Cal. Rptr. 754, 537 P.2d 874]; People v. Talbot (1966) 64 Cal.2d 691, 705 [51 Cal. Rptr. 417, 414 P.2d 633].) Neither section 871.5 nor section 1466 nor section 1538.5 contain express authority for the multiple-appeal process which would result from the People's right to challenge a magistrate's order granting a suppression motion. To infer such authority ignores a consistent course of legislative response to decisional law and effectively renders subdivision (m) of section 1538.5 a nullity. Such a construction of section 871.5, where an alternative construction is available, is to be avoided. (See State Compensation Ins. Fund v. Workers' Comp. Appeals Bd., supra, 88 Cal. App.3d 43, 53.) Moreover, section 871.5 is very limited in scope  far more so than the general appeal statutes, sections 1466 and 1238; the superior court's scope of review is limited to a determination of the validity, as a matter of law, of the magistrate's ground for dismissal. An order granting a suppression motion may give rise to a ground for dismissal but will never, in itself, constitute a ground for dismissal. Accordingly, the majority's construction of section *1004 871.5 represents an expansion of the statute more properly left to the Legislature.[1]
Petitioners' application for a hearing by the Supreme Court was denied April 22, 1982. Bird, C.J., and Broussard, J., were of the opinion that the application should be granted.
NOTES
[1]  Section 871.5, Penal Code provides: "If an action, or a portion thereof, is dismissed by a magistrate pursuant to Sections 859b, 861, 871 or 1385, the prosecutor may make a motion, with notice to the defendant and magistrate, in the superior court within 10 days after the dismissal 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, on the ground that, as a matter of law, the magistrate erroneously dismissed the action or a portion thereof.

"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 people, they shall be prohibited from refiling the action, or the portion thereof, which was dismissed.
".... .... .... .... ...
"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, 999a. Such review may only be sought in the event the defendant is held to answer pursuant to Section 871."
[2]  People v. Belknap (1974) 41 Cal. App.3d 1019 [116 Cal. Rptr. 664], People v. Randall (1973) 35 Cal. App.3d 972 [111 Cal. Rptr. 590] and Cash v. Superior Court (1973) 35 Cal. App.3d 226 [110 Cal. Rptr. 612], cited for the proposition that section 1538.5 provides an exclusive and comprehensive procedure for the pretrial determination and review of the admissibility of evidence obtained by search and seizure, were decided prior to enactment of AB 2383.
[3]  Much is made of the fact that the magistrate who dismissed the complaint is not the same one who granted the motion to quash, and that the section 1538.5 motion was granted before the preliminary hearing. Had the People not wished to proceed under the new statute, in all probability the complaint would have been dismissed by the same magistrate who granted the motion. To consider the two orders without reference to the other is not reasonable for the reality of the situation is that the only basis of the dismissal was the granting of the motion to quash as a matter of law. If the ruling on the motion to quash is erroneous as a matter of law so then is the order of dismissal. To hold otherwise would allow a magistrate's legal rulings on search and seizure issues adverse to the People on which a dismissal is based to be completely insulated from review by higher authority while other legal rulings could be reviewed under section 871.5 by the superior court. We do not believe the Legislature intended this result because defendant, as well as the People, is entitled to a speedy determination of a ruling of an issue of law and, if litigated, the defendant is entitled to protection against refiling. The orders should be and are considered to have been made by one magistrate.
[4]  The review herein is of the order of Judge Kakita denying petitioners' motion under section 995, Penal Code. Inasmuch as this is a review by way of extraordinary writ, to challenge the jurisdiction of Judge Leetham to review the magistrate's orders, we have not been requested to nor do we review the merit of either the motion to quash or the finding of Judge Leetham thereon.
[5]  We note that despite petitioners' contention that section 1538.5 gives an exclusive remedy, and section 871.5 cannot be applied retroactively, they must believe that section 871.5, Penal Code applies to them because instead of seeking an extraordinary writ after the section 871.5 hearing in the superior court, they waited until after the preliminary hearing and they were held to answer before making their 995 motion followed by the present petition. As pointed out by real party in interest, this is exactly the procedure set forth in section 871.5, Penal Code.
[1]  I note with interest that Judge Leetham had the authority to reinstate the complaint apart from review of the motion to suppress evidence. There is authority for the proposition that a dismissal pursuant to Penal Code section 871 is not an available remedy where proofs have not been offered. (Coleman v. Superior Court (1981) 116 Cal. App.3d 431 [172 Cal. Rptr. 135]; Simmons v. Municipal Court (1980) 109 Cal. App.3d 15 [167 Cal. Rptr. 608]. However, in view of section 871.5's language allowing the defendant to be restored to the status quo, the unavailability of section 1538.5 review would result in a pro forma reinstatement, simply allowing the magistrate to properly dismiss pursuant to section 1385.
