What are you trying to stress? Logic, obviously should be tested using unit tests. As you are already aware, stress testing isn't reaqlly about testing that, it's more testsing how your code performs under stressful situations, like when an operation exceeds memory limits or deals with some other environmental issue, such as a downed database. I think of stress testing as a way to assist you in picking out hotspots in your code - in need of tuning.
Because PHP handles many critical errors for you, like memory overload, there is little you can do, except maybe monitor memory consumption and stop before the script haults.
Then there is testing how well your code performs under distributed environments, which is where I personally think PHP stress testing should focus on. How well does your application scale? Does it begin bogging down or even breaking when concurrent requests are made?
Your code should remain thread safe unless you implement some kind of IPC via SHMOP or similar to communicate between processes.
How do you stress test to emulate a distrubuted environment? Under CLI at least you could just have a shell script invoke a bunch of processes and see what happens I guess. On my home network, I have a firefox extension on several computers and I program then to basically begin firing away at the server making requests, uploading large data, etc. Doesn't emulate a real world environment very well (5 computers making simultaneous requests) but I suppose it gives me some idea.
In short, I'm not sure stress testing a PHP application is really worth while, as the environment typically handles most of that for you. You never have to worry about race conditions or deadlock, again, unless you use IPC...which most stress tests are trying to discover.
How does your application handle under great stress or multiple loads in a distrubuted environment:
1) When memory peaks - the script aborts (not much you can do here but buy new hardware and increase the default allowed)
2) When two or more processes are spawned, they will likely never collide. You might run into a situation when you use a file for caching data and forget to check for locks and/or lock it period.
Anyways, I would basically writeup a simple shell script that created the object(s) in question and blasted them with megabytes of quasi-data. I would then have another script invoke this said script several hundred times a minute to emulate a heavy load on a web site, all from the command line.
