Opened 8 months ago

Closed 8 months ago

#370 closed defect (duplicate)

Cached value of __FILE__ in class property

Reported by: evgeniy.petrov Owned by: moo
Priority: critical Milestone: undecided
Component: cacher Version: 3.2.0
Keywords: Cc:
Application: PHP Version: 5.6.30
Other Exts: SAPI: apache2handler
Probability: Always Blocked By:
Blocking:

Description

Hello, I'm getting wrong results due to caching opcode of the same files where FILE or DIR present in static property of class.

Steps to reproduce:

  1. Create 2 files with the same content:
<?php

class Foo
{
    static public $dir = __FILE__;
}

echo Foo::$dir , "\n";
  1. Run first then second file.
  2. The same result returned.

Seems to be related to this feature https://xcache.lighttpd.net/wiki/AutoHardLinking

Change History (3)

comment:1 Changed 8 months ago by evgeniy.petrov

  • Summary changed from Cached value of __FILE__ in static class property to Cached value of __FILE__ in class property

comment:2 Changed 8 months ago by evgeniy.petrov

Actually property can be non static also:

<?php

class Foo
{
    public $file = __FILE__;
}

echo (new Foo())->file . "\n";

comment:3 Changed 8 months ago by evgeniy.petrov

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate for #348

Note: See TracTickets for help on using tickets.