php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35641 not consistent __set method
Submitted: 2005-12-12 04:52 UTC Modified: 2005-12-12 07:52 UTC
From: khad at landak dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.1 OS: linux 2.6
Private report: No CVE-ID: None
 [2005-12-12 04:52 UTC] khad at landak dot com
Description:
------------
in prior 5.1, it is allowed to do: 
class MyClass { 
public function __set($key, &$value) {} 
} 
$c = new MyClass(); 
$c->d=10; 

in 5.1 up: 
that code result this: 
Fatal error: Couldn't execute method MyClass::__set in Unknown on line 0 

I have submit this bug. My question is, is it possible to assign as reference using setter method ? 



Reproduce code:
---------------
class MyClass { 
public function __set($key, &$value) {} 
} 
$c = new MyClass(); 
$c->d=10; 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-12 07:52 UTC] sniper@php.net
No.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 17:01:34 2025 UTC