Exhibit 5.01 Opinion re Legality [Letterhead] July 18, 1996 Sonic Corp. 101 Park Avenue Oklahoma City, Oklahoma 73102 Re: Sonic Corp. (the "Company") Form S-8 Registration Statement/ Our File No. 33566.00101 ------------------------ Gentlemen: We have acted as counsel to the Company in connection with the preparation of the Registration Statement on Form S-8 (the "Registration Statement"), to be filed by the Company with the Securities and Exchange Commission (the "Commission"), relating to 95,000 shares of the Company's common stock, $.01 par value (the "Common Stock"), issuable under the 1991 Sonic Corp. Stock Option Plan (the "Plan"). Based on the foregoing, we are of the opinion that the shares of Common Stock to be issued under the Plan are validly authorized and, upon issuance in accordance with the terms of the Plan, will be legally issued, fully paid and nonassessable. We are members of the bar of the State of Oklahoma and do not hold ourselves out as experts on, or as generally familiar with, or qualified to express opinions under law other than the law of the State of Oklahoma, the corporation law of the State of Delaware, and the law of the United States and the opinion given herein is limited thereto. Very truly yours, /s/ PHILLIPS MCFALL MCCAFFREY MCVAY & MURRAH, P.C. PHILLIPS MCFALL MCCAFFREY MCVAY & MURRAH, P.C.