Guys, I'm just saying you run into speed bumps re-implementing the PHP library. Sure, C++ CAN be faster and more secure, but it's NOT a guarantee. You can easily introduce bugs and exploits while re-implementing these basic functions, which PHP either doesn't suffer, or has fixed over the years.
Boost.Spirit URL parsing
Oh, and the whole regex thing isn't a concern anymore. It's just something I thought I'd use as an example.