#29767 [Com]: Weird behaviour of __set($name, $value);

2005-01-25 Thread eric-php at famderuiter dot net
 ID:   29767
 Comment by:   eric-php at famderuiter dot net
 Reported By:  morten at nilsen dot com
 Status:   Open
 Bug Type: Zend Engine 2 problem
 Operating System: Linux
 PHP Version:  5.0.1
 New Comment:

This problem can also be seen in __get

test case:
-

$name;
  }

  public function __set($name, $value) {
echo "set $name, $value called\n";
$name = 'group_' . $name;
$this->$name = $value;
  }
}

$test = new Test();
for ($i=0; $i<2; $i++) {
  echo $test->name . "\n";
  $test->name = $i;
}

?>

Output:
--
get name called
test_group
set name, 0 called

Fatal error:  Cannot access private property Test::$group_name in
/var/www/AAF/bug.php on line 23

Expected Output:
---
get name called
test_group
set name, 0 called
get name called
0
set name, 1 called

What is happening here?
-
It looks like the 'name' argument in both __get and __set is passed by
reference. 
Clearly this should not be happening because it allows code morphing
and the error messages are very confusing (eg: Cannot access private
property Test::$group_name in /var/www/AAF/bug.php on line 23 <= there
is no reference to $group_name on that line .. only to name .. took me
a while to figure out what was wrong)


Previous Comments:


[2004-08-20 04:52:46] morten at nilsen dot com

further weirdness uncovered with this code;

";
}
  }

  $test = new test;
  $test->kake = 1;
  $test->kake = 2;
  $a = 3;
  $test->kake = $a;
  $a++;
  $test->kake = $a;
  for($a = 0; $a < 10; ++$a)
$test->kake = $a;
?>



[2004-08-20 04:16:34] morten at nilsen dot com

(obvious) workaround is to change:

  if($name[0] != '&') $name = '&'.$name.';';

into:

  $entity = "&$name;";



[2004-08-20 03:55:51] morten at nilsen dot com

Description:

The attached script behaves ilogically


Reproduce code:
---
";
  if($name[0] != '&') $name = '&'.$name.';';
}
  }

  function fetchlist($name) {
global $template;

echo '$template->what = '.$name.'';
$template->what = $name;

  } 

  $template = new template();
  fetchlist('user');
  fetchlist('group');
?>

Expected result:

$template->what = user
Set what to user
$template->what = group
Set what to group

Actual result:
--
$template->what = user
Set what to user
$template->what = group
Set &what; to group





-- 
Edit this bug report at http://bugs.php.net/?id=29767&edit=1


Req #62217 [Fbk->Opn]: default file based session handler does not use streamwrappers

2013-06-28 Thread eric-php at famderuiter dot net
Edit report at https://bugs.php.net/bug.php?id=62217&edit=1

 ID: 62217
 User updated by:eric-php at famderuiter dot net
 Reported by:eric-php at famderuiter dot net
 Summary:default file based session handler does not use
 streamwrappers
-Status: Feedback
+Status: Open
 Type:   Feature/Change Request
 Package:Session related
 Operating System:   any
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

We experimented with a custom file:// streamwrapper to do userland file 
replication to other machines in the cluster (to avoid the costs of a san).

But since PHP has the functionality to override the default file:// 
streamwrapper I would suspect that all internal php functions would use this. 
Otherwise it should be documented that certain internal functions are not using 
streamwrappers.


Previous Comments:

[2013-06-27 09:22:16] yohg...@php.net

Why do you need stream wrapper for files save handler?


[2012-06-03 18:05:44] eric-php at famderuiter dot net

Description:

I was testing with a streamwrapper which replaces the standard 'file://' 
streamwrapper. While testing I found that the session files where not opened 
via the streamwrapper. 
While the workaround is easy (just use a custom session handler like the 
example in the session_set_savehandler documentation), it would be nice to have 
this working by default.

Expected result:

session files are opened via the streamwrappers

Actual result:
--
session files are not opened via the streamwrappers






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62217&edit=1


[PHP-BUG] Req #62217 [NEW]: default file based session handler does not use streamwrappers

2012-06-03 Thread eric-php at famderuiter dot net
From: eric-php at famderuiter dot net
Operating system: any
PHP version:  5.4.3
Package:  Session related
Bug Type: Feature/Change Request
Bug description:default file based session handler does not use streamwrappers

Description:

I was testing with a streamwrapper which replaces the standard 'file://'
streamwrapper. While testing I found that the session files where not
opened via the streamwrapper. 
While the workaround is easy (just use a custom session handler like the
example in the session_set_savehandler documentation), it would be nice to
have this working by default.

Expected result:

session files are opened via the streamwrappers

Actual result:
--
session files are not opened via the streamwrappers

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62217&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62217&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62217&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62217&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62217&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62217&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62217&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62217&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62217&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62217&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62217&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62217&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62217&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62217&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62217&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62217&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62217&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62217&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62217&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62217&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62217&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62217&r=mysqlcfg