Search code examples
phpphp-8php-8.1

What would prevent a PHP die() from working? On my computer die() is not working


This is on MacOS with PHP 8.1.10 installed via homebrew ...

Just a blank index.php code in it with only this code ...

<?php
die('We Should Just Die Here');

throw new \RuntimeException('This exception should never be seen');
?>

And .. render in my browser to see ...

<br />
<b>Fatal error</b>:  Uncaught RuntimeException: This exception should never be seen in /path/to/public/index.php:4
Stack trace:
#0 /Users/my-user/.composer/vendor/laravel/valet/server.php(234): require()
#1 {main}
  thrown in <b>/path/to/public/index.php</b> on line <b>4</b><br />

Same story if I run it command line (taking valet out of the equation) ..

$ php index.php

Fatal error: Uncaught RuntimeException: This exception should never be seen in /path/to/public/index.php:4
Stack trace:
#0 {main}
  thrown in /path/to/public/index.php on line 4

I have already tried ...

  • Upgrading PHP
  • Re-installed Valet
  • Composer updating everything

In my roughly 800 years of writing PHP code I have never seen anything like this. Please if anyone has any help I'm interested.


Solution

  • I've found it. I installed the php-uopz extension a while back. I had completely forgotten about that.

    pecl uninstall uopz fixed this for me.

    Thank you for the rubber ducking stack overflow ;P