OPINION
The State of Arizona petitioned for review of the court of appeals’ opinion holding that a defendant is entitled to credit for time spent in a drug rehabilitation program as time spent “in custody” pursuant to A.R.S. § 13-709(B). We granted review to resolve a conflict between сourt of appeals’ decisions on this issue. We have jurisdiction pursuant to Ariz. Const, art. 6, § 5(3), and A.R.S. § 12-120.24.
FACTUAL AND PROCEDURAL HISTORY
Brian Reynolds (appellant)' pleaded guilty to attempted sale of narcotic drugs. The trial court placed him on five years probation. After violating probation, he was reinstated on intensive probation on condition that he participate in the New Arizona Family, a residential drug treatment program. Appellant violated probation again by failing to complete the program. After the second probation violation, the trial court gave him a mitigated prison term of 3.75 years, and denied appellant credit for *234 the 297 days he spent in the New Arizona Family program.
Appellant appealed, arguing that the trial court erred in denying him credit for presentence incarceration spent in the rehabilitation program because the restrictive nature of the program placed appellant “in custody” within the meaning of A.R.S. § 13-709(B).
1
The court of appeals agreed, and held “that when a defendant is confined in such a program under conditions which the trial court finds are as onerous and as restrictive on movеment and conduct as those a defendant would experience if he were in jail, a defendant is entitled to credit for time if he is later sentenced to imprisonment.”
State v. Reynolds,
DISCUSSION
To resolve the issue in this case, we must determine what the legislature meant when it used the words “in custody” and how our courts have interpreted the “in custody” requirement óf A.R.S. § 13-709(B) that provides:
All time actually spent in custody pursuant to an offense until the prisoner is sentenced to imprisonment for such an offense shall be credited against the term of imprisonment otherwise provided for by this chapter.
When interpreting the meaning of particular statutory provisions, we seek to discern the intent of the legislature. We look primarily to the language of the statute itsеlf and give effect to the statutory terms in accordance with their commonly accepted meanings,
see
A.R.S. § 1-213, “unless the legislature has offered its own definition of the words or it appears from the context that a special meaning was intended.”
Mid Kansas Fed. Sav. and Loan v. Dynamic Dev. Corp.,
We note that the word “custody” is not defined explicitly within the criminal code and it does not appear that the legislature attached any special meaning or definition to the phrase “in custody.” Because some ambiguity exists, the court may examine a variety of factors including the language used, the context, the subject matter, the effects and consequences, and the spirit and purpose of the law.
Korzep,
Use of the word “custody” is not uniform. It is commonly interchangeable with such terms as “imprisonment”, “jail”, “arrest”, and “detention”. Consequently, its meaning varies depending upon the construction of the particular statute under consideration____
[W]e note that A.R.S. § 13-709(B) is located in the chapter of the penal code relating to sentencing. Its stated purpose is to credit a defendant with all time served in presentence incarceration. The wоrd “custody” thus appears in the context of serving a sentence of imprison-ment____ Accordingly, we can reasonably infer that the legislature intended that custody, for purposes of A.R.S. *235 § 13-709(B), be equated with incarceration in a jail or prison and not merely with the substantial restraint оf freedom which is commensurate with an arrest or detention.
We conclude, as did the court of appeals in
Cereceres,
that the legislature intended the words “in custody” to mean actual incarceration in a prison or jail and more than simply a restraint on freedom as onerous as jail or prison would be.
Cereceres
did not break new ground in reaching this conclusion. Arizona court decisions have consistently interpreted the “in custody” requirement of this statute to mean actual or constructive control of prison or jail authorities.
2
See State v. Ritch,
We also note, as did Judgе McGregor in her dissent, that the legislature could specifically have provided for credit for time spent in drug rehabilitation centers but it has not done so. In other instances, when the legislature has intended that defendants receive credit for time spent in custody under different сircumstances, the legislature has expressly outlined exactly what those circumstances are. See, e.g., § 13-605(D) (mandates credit for periods of commitment for diagnostic purposes); § 13-606(B) (mandates credit for periods of civil commitment); § 13-709(C) (mandates credit at resentencing for time served under a vacated sentence); § 13-903(F) (mandates credit pursuant to § 13-901(F) for time spent in jail during defendant’s period of probation).
Jail time credit varies widely among the states, but there are four basic approaches. Because the issue is generally treated as purely statutory, jurisdictions reach many different conclusions. The first approach is taken by jurisdictions that have enacted statutes explicitly providing that a defendant receive credit on a prison sentence for time spent in custody or confinement as а result of the offense for which he is being sentenced.
See, e.g., People v. Rodgers,
Second, other states treat a defendant ordered to a restrictive environment as a condition of probation the same as a defendant detained in jail, and thus give him credit, even though their jail credit statutes do not explicitly require it.
See, e.g., People v. Stange,
The third category of jurisdictions deny credit to a defendant placed on probation and placed in a restrictive environment because he is not “in custody” within the meaning of their statutes.
See, e.g., Grant v. State,
The fourth approach to jail credit is taken by those states with statutes explicitly denying credit for time spent in a rehabilitation program.
See, e.g., Burton v. State,
Appellant and the court of appeals would like to place Arizona into the second category of jurisdictions. To support his position that credit should be given for time spent in rehabilitation, appellant cites
Lock v. State,
Although we agree that our statutes have similar language, we decline to follow the Alaska court because we also believe that our statute must be read harmoniously with the other credit statutes adopted by our legislature. For example, A.R.S. § 13-903(F) states that “[tjime spent
in custody
under § 13-901, subsectiоn F shall be credited to any sentence of imprisonment imposed upon revocation of probation.” (Emphasis added.) Section 901(F) specifically refers to time that the defendant is imprisoned in the county jail. We believe a harmonious interpretation of thesе statutes requires credit only for periods in which defendant is in the actual or constructive control of jail or prison officials. Our court of appeals reached the same conclusion in
Vasquez,
We believe that setting a bright line rule that no credit be given for time spent in a rehabilitation center will further the intent of the legislature. The court of appeals states that it is unlikely that our state legislature has foreseen every circumstance that should properly give rise to presentence incarceration credit. We acсept that a legislature might find it difficult to incorporate every possible circumstance into a statute; however, it is not difficult to incorporate credit for rehabilitation time into a statute’s language. 3
We agree that oftentimes the conditions of a restrictive rеhabilitation center may be equal to or more severe than incarceration. Each rehabilitation program or center will have varying degrees of restrictiveness and severity, perhaps even among participants who have achieved varying levеls of success within the program. Because our statute states that credit is to be given for time spent in custody pursuant to the offense, we believe that the legislature must state otherwise before alternative programs will be deemed “in custody”. The difficulties a trial court would encounter in determining in advance, or at least after *237 the violation of probation, whether each type of rehabilitation program equaled or exceeded the amount of restraint on the defendant’s liberty on a case-by-case basis would result in inconsistent and potentially unfair credit being granted.
We also believe that a potentially serious consequence of allowing credit for probation time spent in rehabilitation is that a probationer would be less encouraged to fulfill the requirements of his probatiоn. As the court of appeals stated in
Vasquez,
“We believe that denying credit for time spent in a treatment program ... encourages probationers to participate fully in such programs and to adhere to their conditions of probation.”
DISPOSITION
We hold that time served in a rehabilitation program is not time served “in custody” for purposes of A.R.S. § 13-709(B). We vacate the court of appeals’ opinion and affirm the trial court’s decision.
Notes
. Because we find that time served in a rehabilitation program, regardless of the severity of the program's restrictiveness, is not time served "in custody" for purposes of A.R.S. § 13-709(B), we need not go into detail as to the specific restrictions applied to appellant at the New Arizona Family. Such a description may be found in
State v. Reynolds,
. This construction is also in accord with thе dictionary definition of custody: “judicial or penal safekeeping: control of a ... person with such actual or constructive possession as fulfills the purpose of the law or duty requiring it: imprisonment or durance of persons----” Webster’s Third New International Dictionary 559 (3rd ed. 1976).
. A gоod example of such language may be found in California Penal Code 2900.5, which provides for credit for time spent "in custody, including but not limited to any time spent in a jail, camp, work furlough facility, half-way house, rehabilitation facility, hospital, prison, juvenile detention facility, or similar residential institution____”
