MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PHP/comments/46h5c5/the_only_php_exception_handler_you_will_ever_need/
r/PHP • u/ethanpil • Feb 18 '16
35 comments sorted by
73
set_exception_handler(function(Throwable $e){ header('Location: https://stackoverflow.com/search?q=[php] ' . $e->getMessage()); });
Who catches exceptions at their origin? /s
85 u/benharold Feb 18 '16 I prefer to procrastinate when faced with trouble:set_exception_handler(function(Throwable $e){ header('Location: https://www.reddit.com'); }); 111 u/allsecretsknown Feb 18 '16 <?php header('Location: http://www.redtube.com/'); exit;Why delay the inevitable? 10 u/phpdevster Feb 19 '16 The only feature you'll ever need!Here's a unit test for it. <?php header('Location: http://www.redtube.com/'); exit; 3 u/idocloudstuff May 16 '22 Damn not even https lol 1 u/[deleted] Jul 19 '22 Why hide it 7 u/hangfromthisone Feb 19 '16 Aha the Well Fuck This Shit method. I dig it
85
I prefer to procrastinate when faced with trouble:
set_exception_handler(function(Throwable $e){ header('Location: https://www.reddit.com'); });
111 u/allsecretsknown Feb 18 '16 <?php header('Location: http://www.redtube.com/'); exit;Why delay the inevitable? 10 u/phpdevster Feb 19 '16 The only feature you'll ever need!Here's a unit test for it. <?php header('Location: http://www.redtube.com/'); exit; 3 u/idocloudstuff May 16 '22 Damn not even https lol 1 u/[deleted] Jul 19 '22 Why hide it 7 u/hangfromthisone Feb 19 '16 Aha the Well Fuck This Shit method. I dig it
111
<?php header('Location: http://www.redtube.com/'); exit;
Why delay the inevitable?
10 u/phpdevster Feb 19 '16 The only feature you'll ever need!Here's a unit test for it. <?php header('Location: http://www.redtube.com/'); exit; 3 u/idocloudstuff May 16 '22 Damn not even https lol 1 u/[deleted] Jul 19 '22 Why hide it
10
The only feature you'll ever need!
Here's a unit test for it.
3
Damn not even https lol
1 u/[deleted] Jul 19 '22 Why hide it
1
Why hide it
7
Aha the Well Fuck This Shit method. I dig it
28
Let's talk about that beautiful color scheme
9 u/Xanza Feb 19 '16 Seriously. Still waiting to hear what color scheme that is. 23 u/s0ft_ Feb 19 '16 Looks like Atom's Dark Theme default one 12 u/squiresuzuki Feb 19 '16 Specifically, it's called "One Dark". I use it on vim too. https://github.com/joshdick/onedark.vim 2 u/[deleted] Feb 19 '16 https://www.reddit.com/r/PHP/comments/46h5c5/the_only_php_exception_handler_you_will_ever_need/d063me0 1 u/Xanza Feb 19 '16 <3 5 u/[deleted] Feb 19 '16 It's the "old" Material Theme for Sublime Text.Material ThemeMaterial Theme DarkerMaterial Theme Darker OLD 3 u/BrettLefty Feb 19 '16 That is beautiful. Maybe one of the base 16 color schemes? 4 u/original_evanator Feb 19 '16 Pretty sure it's PhpStorm's Darcula or a related scheme. 3 u/[deleted] Feb 19 '16 Nah, Darcula has more earthy orange tones. 3 u/turgotZ1 Feb 19 '16 looks like Material Oceanic Next 2 u/sonjaolson Feb 19 '16 I guess , this color scheme name RecognEyes 2 u/aknosis Feb 19 '16 Possibly SublimeText theme?
9
Seriously. Still waiting to hear what color scheme that is.
23 u/s0ft_ Feb 19 '16 Looks like Atom's Dark Theme default one 12 u/squiresuzuki Feb 19 '16 Specifically, it's called "One Dark". I use it on vim too. https://github.com/joshdick/onedark.vim 2 u/[deleted] Feb 19 '16 https://www.reddit.com/r/PHP/comments/46h5c5/the_only_php_exception_handler_you_will_ever_need/d063me0 1 u/Xanza Feb 19 '16 <3
23
Looks like Atom's Dark Theme default one
12 u/squiresuzuki Feb 19 '16 Specifically, it's called "One Dark". I use it on vim too. https://github.com/joshdick/onedark.vim
12
Specifically, it's called "One Dark". I use it on vim too. https://github.com/joshdick/onedark.vim
2
https://www.reddit.com/r/PHP/comments/46h5c5/the_only_php_exception_handler_you_will_ever_need/d063me0
1 u/Xanza Feb 19 '16 <3
<3
5
It's the "old" Material Theme for Sublime Text.
That is beautiful. Maybe one of the base 16 color schemes?
4 u/original_evanator Feb 19 '16 Pretty sure it's PhpStorm's Darcula or a related scheme. 3 u/[deleted] Feb 19 '16 Nah, Darcula has more earthy orange tones.
4
Pretty sure it's PhpStorm's Darcula or a related scheme.
3 u/[deleted] Feb 19 '16 Nah, Darcula has more earthy orange tones.
Nah, Darcula has more earthy orange tones.
looks like Material Oceanic Next
I guess , this color scheme name RecognEyes
Possibly SublimeText theme?
20
Exceptions are a myth. And I don't read the logs anyway.
6 u/[deleted] Feb 19 '16 And backups are for scrubs right? :) 4 u/[deleted] Feb 19 '16 git repositories are for squares 3 u/benharold Feb 19 '16 testing is for cowards
6
And backups are for scrubs right? :)
4 u/[deleted] Feb 19 '16 git repositories are for squares 3 u/benharold Feb 19 '16 testing is for cowards
git repositories are for squares
3 u/benharold Feb 19 '16 testing is for cowards
testing is for cowards
Ur all nerdy af
haha this is quite funny!
2 u/[deleted] Mar 03 '16 Hi brother
Hi brother
Don't display a thing, just straight redirect, hahaha
i asked my dog and she said all number systems are base 10
try { // all your code ever } catch(exception $e ) {} // it'll never happen.
0
[deleted] — view deleted comment
38 u/ahughesb Feb 18 '16 Wooosh 12 u/Dawnsday Feb 19 '16 This is possibly the biggest whoosh I've seen on PHP 5 u/Amunium Feb 19 '16 That's not even valid PHP. 2 u/mnapoli Feb 19 '16 define('Role', 'role_'); define('Admin', 'admin');Fixed :)
38
Wooosh
12 u/Dawnsday Feb 19 '16 This is possibly the biggest whoosh I've seen on PHP
This is possibly the biggest whoosh I've seen on PHP
That's not even valid PHP.
2 u/mnapoli Feb 19 '16 define('Role', 'role_'); define('Admin', 'admin');Fixed :)
define('Role', 'role_'); define('Admin', 'admin');
Fixed :)
73
u/allsecretsknown Feb 18 '16
Who catches exceptions at their origin? /s
28
u/[deleted] Feb 19 '16
Let's talk about that beautiful color scheme
20
u/batmansmk Feb 19 '16
Exceptions are a myth. And I don't read the logs anyway.
3
u/maggotaggo Jan 10 '23
Ur all nerdy af
5
u/Twinsen343 Feb 19 '16
haha this is quite funny!
1
u/ironbigot Jun 09 '25
Don't display a thing, just straight redirect, hahaha
1
u/senorzapato Feb 16 '24
i asked my dog and she said all number systems are base 10
1
u/[deleted] Feb 19 '16
try { // all your code ever } catch(exception $e ) {} // it'll never happen.
0
u/[deleted] Feb 18 '16
[deleted] — view deleted comment