Store code with an ID for easy retrieval:
mysql> CREATE TABLE php_functions (id char(32), code mediumblob);
mysql> INSERT INTO php_functions VALUES ('preg_replace','return preg_replace($argv[1],$argv[2],$argv[3]);');
Then, execute previously stored code:
mysql> SELECT PHP(code,'/[^a-zA-Z]/','*',dish) FROM php_functions,dinner WHERE php_functions.id = 'preg_replace';
+----------------------------------+
| PHP(code,'/[^a-zA-Z]/','*',dish) |
+----------------------------------+
| Soup*Dumpling                    |
| Salt*Baked*Shrimp                |
| Steamed*Whole*Fish               |
+----------------------------------+