|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-16 09:21 UTC] daniel dot beardsley at gmail dot com
[2015-07-26 17:59 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2015-07-26 17:59 UTC] cmb@php.net
[2015-08-09 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 08:00:01 2025 UTC |
Description: ------------ clones an object if using unserialize,spl_autoload_register. This confuses the understanding of. Test script: --------------- spl_autoload_register(function($Class){ /* Include file */ }); /* File Core.php */ class Core{ public $field; public function __construct(){ $this->field = time(); } } /* File Lite.php */ class Lite{ protected $Core; public function __construct($Core){ $this->Core = $Core; } } $Core = new Core(); if(!$Lite = $Cache->Load('Lite')){ $Lite = new Lite(); // Ok ... } echo $Core->field; // Ok ... echo $Lite->Core->field; // Out null. $Core != $Core. $Core new object. Expected result: ---------------- if($Core->field == $Lite->Core->field){ echo 'Ok!'; }else{ echo 'poorly'; } Actual result: -------------- $Core->field != $Lite->Core->field