Jump to content

This is bizarre... I think I found a bug in PHP?


dbo

Recommended Posts

So... I thought there was a bug in my code and I went debugging. Despite telling my system not to cache files, it was doing so anyways. I tracked down the issue to this code:

 

      //IF WE DIDN'T POPULATE THE CONTENTS FROM THE CACHE, AND THE FILE
      //IS CACHEABLE WE WANT TO WRITE IT TO CACHE
      $test = (!$blnFromCache && $this->blnIsCacheable);
      debug_zval_dump($test);
      if( $test )
      {  
         $strFilename = $this->getCacheId();
         //file_put_contents(CACHE_DIR . $strFilename . ".php", $this->strContents);
      }

 

This outputs false for the debug statement... meaning that it should not enter the if statement. Since I've got the file_put_contents thing commented out, the contents are not written to file.

 

So I uncomment it and it writes it to cache. How can it write anything to cache if $test is false? I don't get it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.