
31 Ill.2d 252 (1964)
201 N.E.2d 361
NOBLE W. LEE et al., Appellees,
v.
RETIREMENT BOARD OF THE POLICEMAN'S ANNUITY AND BENEFIT FUND OF THE CITY OF CHICAGO et al.  (HARRY LUSTIG et al., Appellants.)
No. 38157.
Supreme Court of Illinois.
Opinion filed September 29, 1964.
*253 L. LOUIS KARTON, of Chicago, for appellants.
MARY V. NEFF, of Chicago, for appellees.
Decree affirmed.
Mr. CHIEF JUSTICE KLINGBIEL delivered the opinion of the court:
Two taxpayers brought suit in the circuit court of Cook County against the Retirement Board of the Chicago Policemen's Annuity and Benefit Fund. The suit seeks to enjoin the Board and its members from giving pension credit to certain policemen pursuant to a 1959 amendment of the statute. Two members of the police force eligible for benefits under the amendment intervened in the cause. The court granted the relief requested by plaintiffs, holding the amendment unconstitutional, and the intervenors appeal.
The amendment provides that in computing prior service, credit shall be given for all time spent in military service, whether before or after becoming a policeman, "if such policeman shall have been on the eligible register for the position of policeman that existed prior to December 7, 1941 * * *." (Ill. Rev. Stat. 1961, chap. 24, par. 10-7-55.) The eligible list that existed prior to December 7, 1941, was that of the 1938 civil service examination for the position of patrolman. Other eligible lists have come into existence from civil service examinations taken after December 7, 1941, but no policemen from these later lists are entitled to claim credit, under this provision, for time spent in military service.
*254 The plaintiffs challenged the validity of the amendment on the ground, inter alia, that it grants special privileges to those policemen who were on the 1938 eligible list, and that there is no reasonable basis for treating them differently from other policemen with military service who were appointed from a subsequent list. The master to whom the cause had been referred found the limitation invalid on that ground, but recommended that the balance of the provision be upheld. This the court refused to do.
In this court the plaintiffs, without citing any authority thereon, renew their argument that the amendment violates section 22 of article IV of the Illinois constitution and that it cannot be made constitutional by striking out certain words therefrom. To reverse the decree the intervenors urge that the master's position was correct, that only the provision limiting the beneficiaries to those from the 1938 list was void, that when it is stricken the remainder is complete in itself and capable of being executed independently of the rejected portion, and that the clause in question should be applied as if it read "if such policeman shall have been on an eligible register for the position of policeman."
We cannot accept the argument. A legislative classification of persons, to be valid, must rest on some difference which has a reasonable relation to the object of the legislation. (Larvenette v. Elliott, 412 Ill. 523; Frazer v. Shelton 320 Ill. 253.) If the classification is not based on a substantial and reasonable distinction in the situation and circumstances of the individuals embraced therein from those not so included the statute is invalid. (People ex rel. Jendrick v. Allman, 396 Ill. 35.) These rules are not suspended whenever those granted preferential treatment are persons who have been in military service. After referring to such rules this court in the case last cited observed that "It is well established that veteran soldiers and sailors constitute a class to whom the General Assembly may show preferential consideration. To validly do so, however, it must appear *255 that the act by which such preferential treatment is prescribed comes within the rules just above referred to." 396 Ill. at 39.
The intervenors have suggested no distinction, in respect to the purpose of the amendment, between policemen who had been on the designated eligibility register and those who had been on some other eligibility register. Indeed, the intervenors do not attempt to defend the amendment from this constitutional objection, but seek merely to limit the invalidity of the offending restriction, thus making the increased service credits available to all.
The fact that a part of an act is unconstitutional does not require that the remainder shall be held void unless all parts are so connected together as to depend upon each other. (McDougall v. Lueder, 389 Ill. 141.) But where the portions are so connected with each other that the court cannot say the General Assembly would have passed the act with the invalid portion eliminated, the entire act is void. (City of Chicago Heights v. Public Service Co. of Northern Illinois, 408 Ill. 604; Grennan v. Sheldon, 401 Ill. 351; People ex rel. City of Highland Park v. McKibbin, 380 Ill. 447; People ex rel. Roos v. Kaul, 302 Ill. 317.) The sole purpose of the amendment involved in the case at bar was to confer the described benefit upon policemen who had been on the particular eligibility register. The described time in military service was to be counted only "if such policeman shall have been on the eligible register for the position of policeman that existed prior to December 7, 1941." The effect of eliminating the quoted qualification would be to extend the benefits to a much larger group and to greatly increase the burden on taxpayers. (Cf. Winter v. Barrett, 352 Ill. 441, 476.) If the remainder were allowed to stand it would be an entirely different law, in no sense an expression of the legislative will. Where that part of an act which is unconstitutional so limits and qualifies the remaining portion that the latter, when stripped of the unconstitutional *256 provision, is essentially different in its effect and operation from what it would be were the whole law valid, the act must be held invalid as a whole. (Sheldon v. Hoyne, 261 Ill. 222.) We cannot say the legislature would have passed the act with the invalid limitation omitted, and the circuit court was correct in holding it invalid in its entirety.
The plaintiffs have taken a cross appeal from the decree insofar as it assesses them with one half of the master's fee. They argue, again without the citation of authority, that since they were successful in their attack upon the unconstitutional provisions and conferred a benefit thereby upon the public treasury it is the pension fund which should pay the costs and that the chancellor abused his discretion in charging any part to the plaintiffs.
The contention cannot be sustained on this record. Insofar as it is relevant the applicable statute (Ill. Rev. Stat. 1961, chap. 33, par. 18) provides that the costs in chancery cases are in the discretion of the court  a discretion to be exercised according to equitable rules and principles. (La Salle Nat. Bank v. McDonald, 2 Ill.2d 581.) As a general rule the successful party should not be required to pay any portion of the costs, where there is no equitable ground upon which to base an apportionment. (Shapiro v. Grosby, 25 Ill.2d 245.) But it has not been shown that no such equitable ground exists here. All that the plaintiffs urge in support of their contention is that they have prevailed in the suit itself. There is nothing to show they did not cause additional or unnecessary costs, or that there were no other considerations justifying the chancellor's decision in the matter. (Cf. Cities Service Oil Co. v. City of Des Plaines, 21 Ill.2d 157.) The plaintiffs have not met the burden of showing an abuse of discretion.
The decree of the circuit court of Cook County was correct, and it is affirmed accordingly.
Decree affirmed.
