diff --git a/server/pifr_server.environment.inc b/server/pifr_server.environment.inc
index 7dc6414..91034cc 100644
--- a/server/pifr_server.environment.inc
+++ b/server/pifr_server.environment.inc
@@ -442,6 +442,9 @@ function pifr_server_environment_test_evaluate(array $test) {
     $file = pifr_server_file_get_test($test['test_id']);
     $branch = pifr_server_branch_get($file['branch_id']);
   }
+  if (empty($branch['test.php.version'])) {
+    $branch['test.php.version'] = '53';
+  }
   $project = pifr_server_project_get($branch['project_id']);
   $client = pifr_server_client_get($project['client_id']);
 
@@ -449,10 +452,15 @@ function pifr_server_environment_test_evaluate(array $test) {
   $environments = pifr_server_environment_get_all();
   $relevant = array();
   foreach ($environments as $environment) {
+    if (empty($environment['plugin_argument']['phpversion'])) {
+      $environment['plugin_argument']['phpversion'] = '53';
+    }
     if ((empty($environment['client']) || in_array($client['client_id'], $environment['client'])) &&
         (empty($environment['project']) || in_array($project['project_id'], $environment['project'])) &&
         (empty($environment['branch']) || in_array($branch['branch_id'], $environment['branch'])) &&
-        (empty($environment['type']) || in_array($test['type'], $environment['type']))) {
+        (empty($environment['type']) || in_array($test['type'], $environment['type'])) &&
+        ($environment['plugin_argument']['phpversion'] == $branch['test.php.version'])
+    ) {
       $relevant[$environment['environment_id']] = $environment;
     }
   }
