php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dima at snaiper dot net
New email:
PHP Version: OS:

 

 [2006-08-25 19:32 UTC] dima at snaiper dot net
Description:
------------
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


Patches

Pull Requests

History

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] pollita@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pollita
 [2013-07-18 02:14 UTC] pollita@php.net
Adding this today. (already in my local repo)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 13:01:30 2025 UTC