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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.