|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72886 unset a property on object
Submitted: 2016-08-18 20:51 UTC Modified: 2016-08-18 22:00 UTC
From: nikolaspinasco at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: Irrelevant OS: ubuntu
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:
Bug Type:
From: nikolaspinasco at gmail dot com
New email:
PHP Version: OS:


 [2016-08-18 20:51 UTC] nikolaspinasco at gmail dot com
When I try unset() a property on object not instanced this remove a first proporty, please check the script.

Test script:
$object = new stdClass();
$object->test = '1'; 
$object->test_unset = '2';

$object2 = $object;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-18 22:00 UTC]
-Status: Open +Status: Not a bug
 [2016-08-18 22:00 UTC]
Objects don't use by-value semantics. If you want to clone an object, use "$object2 = clone $object".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 07:01:25 2023 UTC