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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 08 14:03:40 2023 UTC