PHP: `get_class($this)` vs `static::class`

Without getting into too much detail, I recently wanted to see what the support was like for
static::class, and came across this SO answer that got me to thinking.

First, it partially correctly stated that
static::class was supported in
PHP>5.5. I have since submitted an edit to correct for
PHP>=5.5, because – INTERNET JUSTICE – and frankly, that distinction matters. Second, the answer said it was much more performant, and while I instinctively knew that to be true, I wanted to see for myself…

Ignoring the calls to
RETURN (for setting up and returning from the method), you can see that the two methods of getting the top level class result in 1 and 4 ops, respectively.

Now, mind you that op-codes are not direct indicators of performance, but they do indicate:

1. How many directives need to be parsed and checked.
2. How many calls to
underlying C-functions need to be made.

It is possible that
FETCH_CLASS_NAME could be incredibly computationally intensive in the underlying C library. It isn’t, however, and is much more performant when compared to the initializing, fetching and sending of the
get_class() alternative.