*/
public function stream_close()
{
- $c = count(self::$instances);
- for ($i = 0; $i < $c; $i++) {
- if (self::$instances[$i] === $this) {
- unset(self::$instances[$i]);
+ foreach (self::$instances as $key => $value) {
+ if ($value === $this) {
+ unset(self::$instances[$key]);
break;
}
}
{
$result = null;
$instance = null;
- $c = count(self::$instances);
- for ($i = 0; $i < $c; $i++) {
- if (self::$instances[$i]->path === $path) {
- $instance = self::$instances[$i];
+ foreach (self::$instances as $i) {
+ if ($i->path == $path) {
+ $instance = $i;
break;
}
}