client icon indicating copy to clipboard operation
client copied to clipboard

Fatal error: Cannot declare class OpenAI, because the name is already in use in E:\Xampp_8.2\htdocs\ia\vendor\openai-php\client\src\OpenAI.php on line 8 [Bug]:

Open neutronixx opened this issue 1 year ago • 1 comments

Description

Installing and testing the repo I get this error: Fatal error: Cannot declare class OpenAI, because the name is already in use in E:\Xampp_8.2\htdocs\ia\vendor\openai-php\client\src\OpenAI.php on line 8

Steps To Reproduce

using the example code on home page i get this error

OpenAI PHP Client Version

v0.8.5

PHP Version

8.2

Notes

No response

neutronixx avatar Apr 18 '24 04:04 neutronixx

I have the same issue, and I couldn't find the answer yet.

NilsCJ avatar Apr 21 '24 18:04 NilsCJ

My issue was that I used use OpenAI\OpenAI;

Fixed with use OpenAI;

graphem avatar May 30 '24 19:05 graphem