JMSAopBundle icon indicating copy to clipboard operation
JMSAopBundle copied to clipboard

Syntax error in file causes silent failure

Open edhgoose opened this issue 8 years ago • 0 comments

Hi,

One of my team and I have just spent a while hunting down a problem which turned out to be a simple syntax error. He's new to PHP and had written the below in a class:

const C = "Something about " . NameOfClass::class;

We've fixed the problem in our code base, but the thing that caused us a lot of problems was that it worked fine on our local environments (running php 5.6) but not in another environment using php 5.5.

The problem turned out to be a fatal silent error here: https://github.com/schmittjoh/JMSAopBundle/blob/master/DependencyInjection/Compiler/PointcutMatchingPass.php#L116

We did some investigation into why the get_class fails, but couldn't determine a way to catch it. Is there a way of catching a fatal error within get_class, or is there anything that can be done to prevent this sort of problem? Appreciate it's a bit of a niche!

Cheers, Ed

edhgoose avatar Jul 19 '16 11:07 edhgoose