Not just any PHP -- they 'rewrote the compiler', or rather wrote a translator that converts PHP into C++, then compiles with g++.
But Facebook did more for PHP: they also created XHProf, a PHP profiler with a (supposedly) easy-to-use HTML interface, designed to pinpoint exactly where your bottlenecks are appearing, so that you can optimize at every stage in the pipeline. Here's how the github readme describes it:
XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level call counts and inclusive and exclusive wall time, CPU time and memory usage. Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs.
If you haven't tried XHProf, you might want to look into it. Installation apparently requires a little nudging, but Nick Lewis just posted a full, practical guide to benchmarking and performance tuning your PHP and MySQL, using XHProf (as well as other techniques) -- a very nice overview of many common bottlenecks and how to open them up.
Nick also links to a great Drupal 6 performance wiki (no complaints now, plenty of users are still on Drupal 6), which is helpfully divided into subsections (big and small performance gains, bug fixes, etc.).
Both resources are worth checking out, especially if you're beginning to feel like PHP runs slowly (when in fact you haven't optimized nearly as well as you could).