Drupal Views rewrite link dependent on boolean value
I finally got it to work as follows:

PHP field, Value Code:

return $data-&gt;field_field_booleanval[0]['raw']['value'];


Output Code:

&lt;?php
  print_r($value);
?&gt;


This returns the correct VALUE for the boolean field. So you can skip the Value Code unless you plan on using the variable elsewhere, and output could look something like:

&lt;?php
  $booleanval = $data-&gt;field_field_booleanval[0]['raw']['value'];
  $fileval = isset($data-&gt;field_field_file[0]); // shouldn't be set if no value

  if($booleanval) {
    echo '&lt;a href="http://www.example.com"&gt;Link&lt;/a&gt;';
  }
  else if(!$booleanval &amp;&amp; !$fileval) {
    echo ' ';
  }
  else {
     echo $row-&gt;field_file;
  }
?&gt;