"Vincent, I think the conversation was about magic_quotes_gpc and not magic_quotes. "
There are only two, magic_quotes_runtime and magic_quotes_gpc.
Runtime escapes everything entering PHP including databases, gpc only escapes data from get/post/cookies.
GPC is turned of for performance reasons that are in line with what I said earlier: you "don't need it" more than you "do need it" and every time you don't need it, PHP has wasted some of your precious CPU cycles.
This is ofcourse a trivial point for small or private websites, but when things become a little more popular you'll soon notice the difference.
"select * from table where some_key = 1\'ab;
and the query would fail. "
Just like it would if you manually used addslashes().
I understand your argument, it's easier to just enable magic-quotes and forget all about addslashes().
There's an added bonus of not having to worry about forgetting addslashes() in some places, but that can be explained both as 'a safety measure' and as 'a lazy programmer' 🙂
In the end, your script should handle the data correctly, not matter what the settings for magic_quotes_xxx are.
The current default is to disable it so I think it's better to write your script so that it works with magic_quotes_gpc disabled.
The best solution I think is to do what I suggested; use a custom addslashes function. If magic_quotes_gpc is already enabled the overhead is minimal, and you can make your script auto-switch when required.