Hi Lukas,

Am Mittwoch, den 13.08.2008, 16:42 +0200 schrieb Lukas Kahwe Smith:
[...]
> Right, this is quite common. So is including drivers inside factory  
> methods. Even if they are not explicit, there is obviously also  
> autoload.

Which is not the same, as far as I understand the proposed modification.
The only case where autoload would be triggered is when the autoload
method is a static method inside a namespaced autoloader class.

> Just so that I get straight why we are doing this:
> The namespace of the file is not magically applied to the included  
> code, so instead one would expect the included code to set the  
> relevant namespace itself.

As far as I understood the discussion, it was related to OP code caches.

The opcode result from this snippet ...
<?php
namespace Foo;
class Bar {
  public function includeFile() {
     require_once 'file.php';
  }
}

... is not the same as the opcode result from the following:
<?php
class Bar {
   public function includeFile() {
       require_once 'file.php';
   }
}

Am I getting this right? Assuming I did, the opcode for including
file.php from Foo::Bar will be the same regardless what happened before,
right? If yes, than I really see no point in this warning.

cu, Lars

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to