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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: khad at landak dot com
New email:
PHP Version: OS:

 

 [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: Tue Jul 15 05:01:33 2025 UTC