To summarize my take on this, I stated two ways in which such a discrepancy could arise:
a) JPG compression errors (aka, "JPG artifacts"); and,
b) color space tagging / conversion problems.
We have not yet ruled out (a). If this is the only problem, the existence of a difference between the value reported by your PHP code and the value reported by one of the standard image editing programs would depend on whether the same JPG decoding library function was called by both PHP and the image editors. I doubt they are, so I still think this is a very viable possibility.
Nor have we ruled out (b), either. As I have now stated multiple times, the easiest and most direct way to rule (b) in or out experimentally is to first settle whether or not (a) is a possibility. You can easily do this if you either (1) generate an image consisting of big blocks of color where there will be no compression artifacts in the middle of these blocks, or (2) conduct a comparison using a file format like lossless TIFF (that has no compression artifacts) instead of using JPGs.
With respect to your question about how to force PS not to do any color space conversions, one can turn off color management in PS by using the "edit / assign profile / do not color manage" command. However if your input file truly is sRGB, and your working color space is also sRGB, then you should see no difference with it on or off. I tried this, and obtained the expected behavior. Since you assured me that this was indeed the case for your actual files, I'm starting to think that a color space conversion problem is less likely, but a simple test with the color blocks or the lossless TIFF files would immediately resolve this. To be honest, I don't understand why you are resistant to doing this since it would only take a couple of minutes of your time to do.
I am not going to do it for you because (i) I have done closely related tests in the past and know that JPG artifacts can easily cause RGB shifts of ten or twenty RGB units if significant compression is involved; and (ii) I don't have your actual file, or even a clue as to how much spatial structure it contains, and hence how severe the artifacts are likely to be.
T