Dry run php script from shell

Is it possible to dry run a php script without actually executing it? Say I need to test the output of a php file to see if it matches a pattern. I need to run this on all php files on the server. But I fear if there are php files that make modifications, sends out mail etc, that should not happen. In short only static php files should be executed. If there is a php script with the following code and when I run "php /path/to/test.php" from the command line, it should not send mail, but just give no output.

test.php contents

<?
mail("email@domain.com", "My Subject", "Line 1\nLine 2\nLine 3");
?>

phpprint.php contents

<?php
print("pattern");
print("\n");
print("pattern2");
print("\n");
?>

Now I run the following

[me@server /]$ php phpprint.php
pattern
pattern2

[me@server /]$ php phpprint.php | grep pattern
pattern

But when I execute the following mail should not go

[me@server /]$ php test.php | grep pattern

see php --help or man php