This case involves the issue of the liability of defendant-railroad and the members of one of its train crews for an accident to an eleven year-old boy. On December 5, 1972, the boy, while walking on defendant’s railroad tracks, was struck by a train and severely injured. Suit was filed by the boy’s mother individually and as guardian ad litem for the boy, against the railroad and the members of the crew of the train which struck him.1
*501• Motions for summary judgment were filed on behalf of the railroad and its employees, relying on N. J. S. A. 48:12-152 which, inter alia, provides that any person injured by an engine or ear while walking, standing or playing on a railroad shall be deemed to have contributed to the injury sustained and shall not recover therefor any damages from the company owning or operating the railroad.
The trial court found the statute controlling and granted summary judgment in favor of the railroad. However, it also ruled that the statutory bar against recovery of damages did not extend to suits against employees of a railroad. Accordingly, it denied their motion for summary judgment.
Counsel for the employees moved for a rehearing of their motion and submitted to the court an unreported opinion of the Appellate Division which had held that the statute controlled with regard to suits against railroad employees as well as the railroad. Based on the foregoing, the trial court then ruled that the suit against the members of the train crew was also barred by N. J. S. A. 48:12-152 and entered summary judgment in their favor. Plaintiffs appealed, challenging the aforesaid rulings. The Appellate Division in an unreported opinion affirmed. This Court granted certification. 75 N. J. 18 (1977). We reverse in part.
The statute in question, N. J. S. A. 48:12-152, provides as follows:
It shall not be lawful for any person other than those connected with or employed upon the railroad to walk along the tracks of any railroad except when the same shall be laid upon a public highway.
Any person injured by an engine or car while walking, standing or playing on a railroad or by jumping on or off a car while in motion shall be deemed to have contributed to the injury sustained and shall not recover therefor any damages from the company owning or operating the railroad. This section shall not apply to the *502crossing of a railroad by a person at any lawful public or private crossing.
It has uniformly been held that the statute operates as an absolute bar to recovery of damages for injuries unless willful or wanton conduct is shown.2 Erie R. Co. v. Duplak, 286 U. S. 440, 52 S. Ct. 610, 76 L. Ed. 1214 (1932); Erie R. Co. v. Hilt, 247 U. S. 97, 38 S. Ct. 435, 62 L. Ed. 1003 (1918); Egan v. Erie R. Co., 29 N. J. 243 (1952); Hess v. Atlantic City Railroad Co., 95 N. J. L. 494 (E. & A. 1921). The statutory bar extends to infant trespassers as well as to adults. Egan, supra, 29 N. J. at 248-250.
When the statute was enacted, the policy of the common law of Yew Jersey was that a landowner owed no duty of care to a trespasser other than to refrain from causing injury to such person by wilful and wanton conduct. The statute adopted this policy in an unqualified form in relation to railroads. Egan, supra, 29 N. J. at 250-251.
However, immunity from tort liability is not favored in the law since it bars the injured person from the recovery of compensatory damages against the party who is otherwise responsible for the injury. Immer v. Risko, 56 N. J. 482, 495 (1970); Willis, et al. v. Dept. of Cons. & Ec. Dev., 55 N. J. 534, 537-539 (1970); Collopy v. Newark Eye and Ear Infirmary, 27 N. J. 29, 47-48 (1958). For that reason, statutes such as N. J. S. A. 48:12-152 must be strictly construed and not extended beyond their plain meaning.
The bar against recovery contained in N. J. S. A. 48:12-152 by its terms extends to “the company owning or operating the railroad.” The Legislature did not expressly include employees of the railroad and we do not find in the statute an indication that this was intended.
*503It is one thing to relieve a railroad from liability to trespassers because of its vital function as an instrument of transportation and commerce, the enormous territory it necessarily encompasses and the practical impossibility of guarding against trespassing. Egan, supra, 29 N. J. at 253. However, this rationale does not extend to relieving a railroad employee from responsibility for the consequences of his own negligent conduct.
Accordingly, we conclude that the provisions of N. J. S. A. 48:12-152 apply only to the railroad and not to railroad employees. The grant of summary judgment, therefore, in favor of defendant-employees must be reversed and the matter remanded for trial.
As to the railroad, plaintiffs ask that we reconsider our holding in Egan, supra, and declare N. J. S. A. 48:12-152 unconstitutional and in violation of the equal protection provisions of our State and Federal Constitutions. Plaintiffs also submit that the statute unconstitutionally grants immunity to a special class, contrary to the provisions of the New Jersey Constitution, Art. IV, § VII, pars. 7, 8 and 9 (8).
We find no constitutional infirmity. The statute was first enacted in 1869, L. 1869, c. 285. Its validity has not been questioned in the many cases which have applied its provisions. Erie R. Co. v. Duplak, supra; Erie R. Co. v. Hilt, supra; Hess v. Atlantic City Railroad Co., supra; Barcolini v. Atlantic City & S. R. Co., 82 N. J. A. 107 (Sup. Ct. 1911); Mack v. Lehigh Val. R. Co., 283 F. 2d 405 (3 Cir. 1960), cert. den. 365 U. S. 818, 81 S. Ct. 700, 5 L. Ed. 2d 696 (1961). In Egan, supra, 29 N. J. at 252-254, a direct attack on the statute on equal protection grounds was rejected by this Court. In so doing we found that the legislative classification made in the statute had a reasonable basis because of the subject matter involved. We have been shown no reason to question now the Egan holding, the rationale of which extends to plaintiff’s additional argument that the statute unconstitutionally grants immunity to a special class.
*504We recognize that the statutory provision might well merit legislative attention. As noted, it is bottomed on the old common law doctrine of New Jersey that an owner of land owed no duty of care to a trespasser except to refrain from causing injury to such person by willful or wanton conduct. That doctrine has now been modified in this State so as to put the interest of the parties in better balance. Simmel v. New Jersey Coop. Co., 28 N. J. 1 (1958); Imre v. Riegel Paper Corp., 24 N. J. 438, 444-445 (1957); also, see generally, Annotation, “Duty to take affirmative action to avoid injury to trespasser in position of peril through no fault of landowner,” 70 A. L. R. 3d 1125 (1976). Also, in 1973 the Legislature enacted the Comparative Negligence Act, N. J. S. A. 2A:15-5.1 et seq. which has substantially changed the common law rule that contributory negligence was a bar to tort recovery.3
In short, we conclude as we did in Egan that N. J. S. A. 48:12-152 is a constitutionally permissible expression of legislative intent. We also conclude that the statutory bar against recovery from the railroad extends to any claimed vicarious liability of the railroad for the acts or omissions of its employees.
The judgment in favor of defendant-railroad is affirmed without costs. The judgment in favor of defendant-employees is reversed and the matter remanded for trial.
The suit also joined as defendants certain property owners and businesses adjacent to tbe scene of the accident. These defendants, *501on motions, were granted summary judgments in their favor and plaintiffs have not challenged these rulings on appeal.
There are a few other exceptions which are not here pertinent. See e. g., Kovacs v. Pennsylvania R. R. Co., 76 N. J. Super. 451, 458 (App. Div. 1962).
The 1973 Comparative Negligence Act, by its terms, applies only to causes of action arising after its effective date. Plaintiff’s accident happened on December 5, 1972. Even if we were to find in the enactment of the Comparative Negligence Act a legislative intent to modify N. J. S. A. 48:12-152 so as to eliminate the absolute bar to recovery, it would not benefit plaintiffs.