Bug #53289 [Fbk->Nab]: about __destruct
| From: | reeze@php.net | Date: | Sat, 13 Oct 2012 18:50:05 +0000 |
| Subject: | Bug #53289 [Fbk->Nab]: about __destruct | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174075@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53289&edit=1
ID: 53289
Updated by: reeze@php.net
Reported by: asersz at gmail dot com
Summary: about __destruct
-Status: Feedback
+Status: Not a bug
Type: Bug
Package: Scripting Engine problem
Operating System: Windows 7
PHP Version: 5.2.14
Block user comment: N
Private report: N
New Comment:
@see http://3v4l.org/QJMph
卿æççæ¬ä¸é½è¡¨ç°æ£å¸¸ããä½ çæè¿°æç¹ä¸æ¸
æ¥ãè¿æ®µä»£ç æ¬æ¥å°±ä¸ä¼æä»ä¹è¾åºã
æå
å
³éäºï¼å¦ææé®é¢ä½ åreopenå§ã
I can't reproduce it, seems not a but,
Closed for now, if you have any issues, please reopen it.
Previous Comments:
------------------------------------------------------------------------
[2012-03-29 15:16:15] php dot net at doppy dot nl
I'm unable to reproduce any error's or a white screen.
Code looks fine, although it is a bit of a strange construction.
Recommend closing this bug as "not a bug" as it has been open for 1,5 years now.
------------------------------------------------------------------------
[2010-11-10 23:37:44] felipe@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
I can't reproduce any problem with this test script.
------------------------------------------------------------------------
[2010-11-10 09:25:36] asersz at gmail dot com
Description:
------------
I am not good at english..
Read the following code ..
An error occurs when you run it..
(there will be white-screen in my codes.)
Chinese :
å¦æä½ è½çæä¸æ.飿好ä¸è¿äº.
ä¸é¢çä»£ç æè®¤ä¸º__destruct被继æ¿ä¹å,
ä¼å¯¼è´ä¸é¢ä¸¤ä¸ªç±»ç对象å¨éæ¾æ¶åºç°æ æ³æ¾å°static
$childsçé误.
使¯å¨æç代ç éé¢ä»ç¡®å®æ²¡æåºç°è¿ä¸ªé误,
åèè¿è¡äºå¾ä¹
ä¹ååºç°äºç½å±.
çä¸å»å¾åä¸ä¸ªæ»å¾ªç¯.
Test script:
---------------
error_reporting(E_ALL);
ini_set('display_errors', 'on');
abstract class Father {
private static $childs = array();
public static function getChild( $child ) {
if (!array_key_exists("$child", self::$childs)) {
self::$childs["$child"] = new $child;
}
return self::$childs["$child"];
}
public function __destruct() {
foreach (self::$childs as $i => $child) {
self::$childs[$i] = $child = null;
}
}
}
class Child1 extends Father {}
class Child2 extends Father {}
$child1 = Father::getChild('Child1');
$child2 = Father::getChild('Child2');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53289&edit=1