
262 Cal.App.2d 438 (1968)
THE PEOPLE, Plaintiff and Respondent,
v.
ROBERT ORONA VILLAREAL, Defendant and Appellant.
Crim. No. 3130. 
California Court of Appeals. Fourth Dist., Div. Two.  
May 23, 1968.
 Thomas J. Keenan, under appointment by the Court of Appeal, for Defendant and Appellant.
 Thomas C. Lynch, Attorney General, William E. James, Assistant Attorney General, and Thomas Kallay, Deputy Attorney General, for Plaintiff and Respondent.
 KERRIGAN, Acting P. J.
 Convicted of the unlawful possession of heroin (Health & Saf. Code,  11500) and sentenced to state prison, defendant appeals: *441
 Garden Grove Police Officer Nourse had been working the narcotics detail for nearly five years. State Parole Officer Ryan informed Nourse that George Sianez, a parolee residing in Garden Grove, was armed, dealing in narcotics, and wanted for violation of parole. Ryan furnished Nourse with the parolee's address, gave him the parolee's physical description, and showed him a "mug shot" of the parolee.
 On December 14, 1966, seven plainclothes law enforcement officers, including Officers Nourse and Ryan, arrived at the parolee's residence between 8-8:30 p.m. in the evening. It appeared that no one was home so the officers quietly left and returned at 10 p.m. the same night. The officers parked some distance south of the residence and approached on foot. As they proceeded towards the parolee's home, Officer Nourse noted an obscure figure peering through the curtains of the home, and suddenly the person disappeared. Nourse alerted his fellow-agents to the effect that they had been observed and then ran to the rear of the residence while the other officers covered the front. In the rear yard, Nourse saw defendant walking from the house. Initially, Nourse assumed that the defendant might be one of his fellow-officers and "hollered" to him, but defendant kept walking. When defendant was a distance of 20 feet away, the officer shined his flashlight on him. The defendant resembled the description of Sianez, which led the officer to believe that he possibly was the parolee. He yelled, "Stop, police officer," and shined his flashlight on his badge which he was holding in his left hand. When the officer asked the defendant to identify himself, the latter initially told him to "go to hell," but then stopped as the officer approached him.
 The officer ordered defendant to place his hands against the side of the house, and the latter complied. As the officer started to search him for weapons, defendant hit the officer in the stomach and started to run. The officer pursued him, and in the ensuing struggle, the officer was successful in throwing the defendant to the ground, but still could not control him. Two other officers joined in assisting Officer Nourse in subduing the defendant, and during the course of the struggle, Nourse told defendant that he was under arrest and to quit resisting. During the course of the struggle, Nourse hit defendant on the head with his service gun, and after applying further force, the officers were successful in overcoming the defendant. Defendant sustained a laceration from the blow on the head, a black eye, and a bruise on the left side of *442 his face. One of the officers had his glasses broken and incurred facial bruises.
 Defendant was handcuffed, informed that he was under arrest for assaulting a police officer and for resisting arrest, and was taken into the parolee's home and searched for weapons. None were discovered. He was placed in a chair. The officers then unsuccessfully conducted a 30-minute search of the entire residence for Sianez. Upon concluding their search of the home, the defendant was subjected to a personal search, which culminated in the finding of $654 in bills, one benzedrine-amphetamine pill, and a powder equivalent to 20 "caps" of adulterated heroin.
 Defendant testified in his own behalf to the following effect: he was employed as a dry cleaner; he had suffered conviction of a felony when he was 18 and was released from prison in November 1962 at the age of 25 years; while imprisoned, he was charged with the offense of possession of a deadly weapon, to wit, a knife; on the evening of his arrest, he went riding with a friend named "Joe" at 8:30 p.m.; he knew Sianez and had grown up with him but did not know that the parolee lived at the place where the arrest occurred; when he and his companion arrived at the Sianez home, Joe got out of the car and he remained in it for 10-15 minutes; when Joe failed to return, he got out of the car to look for him; as he entered the rear yard, he saw some people; he called out, "Who's there?" and some lights were shined on him; a voice said, "Hold it"; three people ran towards him and grabbed him; he did not know that the men were officers as none were in uniform; no one shined a light on a police badge; when he resisted, a struggle ensued and he was hit by a hard object; after being apprehended, Officer Nourse searched him inside the house and found two "bennies" in his left front pocket; Joe had given him the pills; the pill is utilized to enable a person to keep awake; he knew he could not lawfully possess a "bennie" without a prescription, and that possession of the pill constituted a violation of the narcotics laws; it was not until Officer Nourse searched him a second time that the heroin was discovered; the piece of paper containing the heroin was not on his person before the search by Nourse; in his opinion, Officer Nourse "planted" the heroin on him; the $650 constituted his savings which had been held for him by a secretary at his place of employment; he planned to use the money to buy a car.
 The payroll clerk at the defendant's place of employment verified that defendant had given her money from his earnings *443 and that she had turned over $600 of his savings to him shortly before his arrest.
 During the prosecution's case-in-chief, and in the course of the cross- examination of the defendant, hearsay testimony was admitted by the trial court in the jury's presence, over defense counsel's objection, on the issue of probable cause. This hearsay related to the criminal background of Sianez, his involvement in narcotic activities, and defendant's association with Sianez. Officer Nourse's testimony relating to such issue may be summarized as follows: he had been given information by the state parole agent as to the parolee's name, address and physical description; he was further advised that the parolee was possibly dealing in narcotics; he had further been informed that the parolee was possibly armed. Other law enforcement agents participating in the investigation of Sianez reiterated the foregoing hearsay data regarding Sianez in connection with the prosecution's case-in-chief.
 Defendant had given his testimony on direct examination to the effect that Officer Nourse had planted the heroin on him. The defendant was cross- examined extensively concerning his association with the parolee Sianez, in an endeavor to connect the parolee with the defendant. The effect of this line of interrogation was to bring before the jury the fact that Sianez was a parole violator dealing in narcotics, which fact was solely the product of hearsay evidence admitted on the issue of probable cause.
 However, the trial court did admonish the jury at the time the hearsay evidence was elicited to the effect that the evidence was limited in that it was admitted not necessarily for the truth of what was said, but on the basis of such hearsay providing a reason for "further action."
 Defendant maintains that his conviction was invalid for the following reasons: (1) His arrest was illegal and the heroin found on his person as the result of the search incident to such arrest was therefore inadmissible; and (2) the trial court committed prejudicial error in admitting hearsay evidence before the jury on the issue of probable cause.
 [1a] In attacking the validity of the arrest, defendant first maintains that a peace officer's right to search a parolee without a showing of reasonable or probable cause (People v. Hernandez, 229 Cal.App.2d 143, 150-151 [40 Cal.Rptr. 100]) does not also permit the police to detain, interrogate and search a third party who is "in some manner" merely associated with the parolee. While conceding that the police officers, *444 acting in conjunction with Sianez' parole officer, had a right to arrest and search Sianez as a parole violator, defendant maintains that the right to arrest and search Sianez did not vest the police with the corollary right to detain, interrogate and search him. Logically, defendant's argument assumes that the defendant's arrest was predicated on the right to arrest Sianez, but a true resolution of the issue requires a review of the evidence to determine whether there were legal grounds independent of the parolee's contemplated arrest to stop, search and arrest the defendant.
 The evidence reflects that Officer Nourse had reasonable grounds for detaining and searching the defendant under the circumstances present here. He rushed to the backyard where the detention occurred for the purpose of apprehending a parole violater believed to be armed. The defendant was observed leaving the parolee's residence under cover of darkness. When the officer ordered the defendant to stop and displayed his badge in the light emanating from his flashlight, and inquired as to the defendant's identity, the latter's response was to tell the officer to go to hell. The officer was justified in searching the defendant's person for weapons. He originally believed that the defendant might be the parolee. This mistake in identity was reasonable because it was dark, and because of the lack of light the description of Sianez appeared to match the defendant. [2] It is not unreasonable for an officer to detain an individual where such person resembles a suspect. (People v. Bird, 248 Cal.App.2d 307, 310 [56 Cal.Rptr. 501]; People v. Campos, 184 Cal.App.2d 489, 493 [7 Cal.Rptr. 513].)
 While conducting a perfunctory search of defendant for weapons, the latter hit the officer in the stomach and attempted to flee from the scene of detention. [3] While mere flight at the approach of an officer is not, of itself, grounds for arrest, the officer is acting within his prerogatives in investigating the reason for the flight. (People v. Alvarado, 250 Cal.App.2d 584, 589 [58 Cal.Rptr. 822]; People v. Villalobos, 245 Cal.App.2d 561, 564 [54 Cal.Rptr. 60].) [4] Furthermore, there is nothing unreasonable in an officer's questioning suspicious persons outdoors during the nighttime hours (People v. Blodgett, 46 Cal.2d 114, 117 [293 P.2d 57]; People v. Simon, 45 Cal.2d 645, 650 [290 P.2d 531]), and while investigating a suspect, the officer may make a cursory search for concealed weapons in order to insure his own safety. (People v. Martin, 46 Cal.2d 106, 108 [293 P.2d 52]; *445 People v. Davis, 260 Cal.App.2d 186, 189 [67 Cal.Rptr. 54]; People v. Alvarado, supra, 250 Cal.App.2d 584, 590.) Although circumstances authorizing the temporary detention of a suspect have not been articulated with precision, the following criteria have been suggested in determining the legality of the detention: (1) There must be a rational suspicion by the peace officer that some activity out of the ordinary is taking place; (2) there must be some indication to connect the person under suspicion with the unusual activity; (3) there must be some suggestion that the activity is related to crime. (People v. Henze, 253 Cal.App.2d 986, 988 [61 Cal.Rptr. 545].) [1b] The circumstances herein were sufficient to authorize the officer to detain the defendant temporarily to ascertain his identity as a possible parole violator and to search him for the purpose of determining whether he was armed.
 Defendant next maintains that even assuming that Officer Nourse was justified in stopping and detaining him in order to determine his identity, it was then incumbent upon the officer to make known his identity so that the person detained may have knowledge of the officer's authority and thereby refrain from resisting arrest. "A person making an arrest must inform the person to be arrested of the intention to arrest him, of the cause of the arrest, and his authority to make it, ..." (Pen. Code,  841.) [5] A temporary detention may be akin to an arrest inasmuch as during the time of such detention, the person detained, if he is physically deprived of his freedom of action in any significant way, may be considered to be in custody. (See People v. Kelley, 66 Cal.2d 232, 246 [57 Cal.Rptr. 363, 424 P.2d 947]; People v. Arnold, 66 Cal.2d 438, 448 [58 Cal.Rptr. 115, 426 P.2d 515].) "If a person has knowledge, or by the exercise of reasonable care, should have knowledge, that he is being arrested by a peace officer, it is the duty of such person to refrain from using force or any weapon to resist such arrest." (Pen. Code,  834a.) [6] However, under section 841 of the Penal Code, a peace officer making an arrest is exempt from the duty to inform the person arrested of the intention to arrest him or the cause of the arrest and the authority to make it when he has reasonable cause to believe "that the person to be arrested is actually engaged in the commission of, or an attempt to commit, an offense, or the person to be arrested is pursued immediately after its commission, or after an escape." There is credible evidence that Officer Nourse identified himself *446 when he first approached the defendant. The officer could have reasonably believed that the defendant was actually George Sianez attempting to escape. [7] Supplementally, even assuming that Officer Nourse failed to comply with section 841 of the Penal Code, and that such failure did not come within the exemption provisions of said section, such failure would not affect the admissibility of the evidence secured by a search incidental to an otherwise lawful arrest. (People v. Maddox, 46 Cal.2d 301, 305 [294 P.2d 6]; People v. Cove, 228 Cal.App.2d 466, 472-473 [39 Cal.Rptr. 535].) It should be also emphasized that Officer Nourse apparently did not have sufficient time to apprise the defendant as to the reason for his detention or as to the reason for the search inasmuch as he was immediately assaulted by the defendant and, consequently, strict compliance with section 841 of the Penal Code was literally impossible. Significantly, the defendant was advised that he was under arrest in the course of the struggle which occurred during his attempt to flee the scene of the detention.
 [8] Finally, the legality of the detention and the subsequent search for weapons in the backyard of the parolee's residence being based on factors equated with probable cause, Officer Nourse was also acting with propriety in searching the defendant after being assaulted. At the bare minimum, the defendant's attack on the officer constituted an assault and battery upon the person of a peace officer. (Pen. Code,  241, 243.) It necessarily follows that the defendant was subject to arrest. (Pen. Code,  836, subd. 1, 3.) Defendant urges that we rule as a matter of law that he did not act unlawfully when he struck the officer and resisted arrest since he could not have known that Officer Nourse was a policeman because the latter was not in uniform and merely identified himself by shouting his official capacity under cover of darkness. However, Officer Nourse displayed his badge to the defendant by use of his flashlight when he first approached him and when he was only a distance of 20 feet from the defendant. In People v. Hooker, 254 Cal.App.2d 878 [62 Cal.Rptr. 675], a Los Angeles police officer, working part time as a Thrifty Drug employee detecting and apprehending shoplifters, followed defendant outside of the store, displayed his badge and stated he was a police officer and was arresting the defendant for shoplifting; apparently he was not in uniform at the time of effecting the arrest; the reviewing court held that the ensuing physical resistance of the defendant directed against the peace officer justified the defendant's conviction for resisting arrest under section 834a of the Penal Code. *447
 Accordingly, defendant assaulted an officer and resisted lawful arrest. It is axiomatic that a search of the person conducted as an incident to a lawful arrest is valid and, therefore, the heroin was properly admitted into evidence. (United States v. Rabinowitz, 339 U.S. 56, 60, 64 [94 L.Ed. 653, 657, 659, 70 S.Ct. 430, 432, 434]; People v. Ross, 67 Cal.2d 64, 69 [60 Cal.Rptr. 254, 429 P.2d 606].)
 [9] Defendant next maintains that there was no proof made by competent testimony that George Sianez was on parole and was a parole violator, and that there consequently was "no probable cause ... shown for the detention of the defendant as possibly being George Sianez." However, no such showing is required. A person on parole remains under the legal custody of the State Department of Corrections and may be returned to the prison walls without notice and hearing. (Pen. Code,  3056; In re McLain, 55 Cal.2d 78, 85 [9 Cal.Rptr. 824, 357 P.2d 1080]; People v. Hernandez, supra, 229 Cal.App.2d 143, 149.) It necessarily follows that a parole officer's apprehension of his prisoner for suspected violation of parole is not an "arrest" in the ordinary sense that a police officer arrests a private individual suspected of a crime, but a mere transfer of the subject from constructive custody into actual or physical custody. (People v. Limon, 255 Cal.App.2d 519, 521-522 [63 Cal.Rptr. 91]; People v. Denne, 141 Cal.App.2d 499, 509-510 [297 P.2d 451].) Standards governing the arrest and search of citizens possessed of full civil rights are therefore not applicable to the rearrest of a parolee. (People v. West, 253 Cal.App.2d 348, 354 [61 Cal.Rptr. 216]; People v. Hernandez, supra, p. 150.)
 [10] Defendant further contends that Sianez' parole officer should have been called as a witness to establish probable cause that Sianez was a parole violator. Manifestly, defendant's arrest stands on legal grounds independent of the contemplated arrest of Sianez. Officer Nourse reasonably mistook defendant for Sianez, which mistake was not only understandable under the factual circumstances before us, but constituted one of the factors enabling him to initially detain and search the defendant. Further, the rearrest of Sianez would have been lawful under the foregoing authorities.
 [11] In conclusion, defendant meritoriously maintains that evidence offered on the issue of probable cause to arrest the parole violator and the defendant should have been considered by the court outside the presence of the jury. The determination of the legality of an arrest or search is a question *448 involving the admissibility of evidence. Accordingly, it is a question of law to be determined by the court outside the presence of the jury. (People v. Gorg, 45 Cal.2d 776, 780-781 [291 P.2d 469]; People v. Swayze, 220 Cal.App.2d 476, 488 [34 Cal.Rptr. 5].) However, the mere fact that the jury heard the testimony on the issue of probable cause does not require a reversal where there is substantial evidence to warrant the verdict. (People v. Phillips, 249 Cal.App.2d 663, 669 [57 Cal.Rptr. 665].)
 In the case under review, the evidence of defendant's association with Sianez is insignificant when contrasted with the proof of his guilt. Fifteen-to-twenty caps of adulterated heroin powder were found on his person, together with a minor quantity of a dangerous drug. The evidence that he possessed narcotics was conclusive.
 The attempted appeal from the order denying a new trial is dismissed inasmuch as such an order is nonappealable. (Pen. Code,  1237; People v. Justice, 211 Cal.App.2d 660, 662 [27 Cal.Rptr. 465].)
 The judgment of conviction is affirmed.
 Tamura, J., concurred.
