and we are curious what happens. Two people guessed E_STRICT error -- that is very unlikely, E_STRICT means this has a meaningful result just PHP really does not like the syntax, the way of calling or somesuch. Another two guessed "Just segfaults because the internal structure isn't there" now come on, PHP is not that crappy. The four who guessed string(24) "foobar broken class name" really intrigues me -- just how on earth could the object persist that string? Ten altogether guessed some error (notice 4, warning 4, fatal 2) -- these are the rational guesses. The seven who correctly guessed string(0) "" IMO cheated because there is no rhyme or reason this should not error out. ReflectionClass keeps the name passed to the internal constructor in the name property and also an internal structure based on this. This is mentioned in a manual comment. Why on earth would the name property be initialized to anything at all? Finally, if you were among the four who guessed Something totally else I would like you to tell us what did you think will happen.

Now comes the really interesting twist, running var_dump($x->getFileName());. What happens? Let me tell you first: this fatals out because the internal structure is not there. There were a lot less results and they were evenly distributed so it's a lot less fun. However, "The name of the file this code is in" is another very illogical answer. The rest has some reasoning behind them.