#48476 [Opn->Asn]: cloning extended DateTime class without calling parent::__constr crashed PHP

From: Date: Fri, 05 Jun 2009 09:33:18 +0000
Subject: #48476 [Opn->Asn]: cloning extended DateTime class without calling parent::__constr crashed PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-138052@lists.php.net to get a copy of this message
ID: 48476 Updated by: derick@php.net Reported By: rvanvelzen at expert-shops dot com -Status: Open +Status: Assigned Bug Type: Reproducible crash Operating System: CentOS 5.2 PHP Version: 5.2.9 -Assigned To: +Assigned To: derick Previous Comments: ------------------------------------------------------------------------ [2009-06-05 09:29:05] rvanvelzen at expert-shops dot com Description: ------------ When trying to clone an extended class of DateTime of which the constructor doesn't call parent::__construct, this causes PHP to die. Reproduce code: --------------- <?php class MyDateTime extends DateTime { public function __construct() { } } var_dump(clone new MyDateTime); ?> Expected result: ---------------- object(MyDateTime)#2 (0) { } Actual result: -------------- Nothing, PHP crashes ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48476&edit=1

« previous php.bugs (#138052) next »