I am trying to make a PHP script talk to the user. Do I need flash?
I assume by talk, you mean play audio. You do not need flash, javascript can do this.
Use JavaScript, yes. To compile the audio, use http://public.research.att.com/~ttsweb/tts/demo.php. If you wanted to be a real hacker, you can write a script that posts to that website and receives the response (which contains a link). Pass the URL of the audio file to the user through your JavaScript. Presto, text-to-speech.
On a windows server you can do:
$voice = new COM("SAPI.SpVoice");
$voice->Speak("Hello, lets have a conversation");
For linux you'll need php-vox installed. Check out a demo page of it working here.
If you want to avoid Flash, a cool but somewhat new plugin that has a service for local text to speech is Yahoo's BrowserPlus. The specific service you want to look at is the TextToSpeech service (http://browserplus.yahoo.com/developer/services/ , scroll down to TextToSpeech). To implement, it requires a javascript call and for your user to install the BrowserPlus plugin.
Your question is still not specific enough. Talking can have many possible contexts. Do you mean a program that will read aloud syntax errors? Do you mean a talking IDE? Or do you mean a program that will converse with a programmer, as in a Dialog System? The computational requirements for each of the three are vastly different, as is the level of their AI.