|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57196 Support for = overloading
Submitted: 2006-08-25 19:32 UTC Modified: 2013-07-18 02:14 UTC
From: dima at snaiper dot net Assigned: pollita (profile)
Status: Closed Package: operator (PECL)
PHP Version: Irrelevant OS: Irrelevant
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dima at snaiper dot net
New email:
PHP Version: OS:


 [2006-08-25 19:32 UTC] dima at snaiper dot net
Will good if programmer can overload "=" asssing operator.

For example

class test {

   protected $var;

   function __assign($v) {
      $this->var = $v;

   function __construct($v) {
      $this->var = $v;

$a = new test(321); // 321
$a = 123; // 123


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-25 19:33 UTC] dima at snaiper dot net
var_dump($a); // object test, value 123
 [2013-07-18 02:14 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: pollita
 [2013-07-18 02:14 UTC]
Adding this today. (already in my local repo)
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Oct 05 04:01:24 2023 UTC