Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44987 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5333 invoked from network); 16 Jul 2009 15:59:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2009 15:59:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=mathieu.suen@easyflirt.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mathieu.suen@easyflirt.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain easyflirt.com designates 91.199.255.56 as permitted sender) X-PHP-List-Original-Sender: mathieu.suen@easyflirt.com X-Host-Fingerprint: 91.199.255.56 python-06.easyrencontre.com Linux 2.6 Received: from [91.199.255.56] ([91.199.255.56:54598] helo=mail.easyflirt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/C1-30986-27E4F5A4 for ; Thu, 16 Jul 2009 11:59:47 -0400 Received: by mail.easyflirt.com (Postfix, from userid 104) id CBDB56375D1; Thu, 16 Jul 2009 17:59:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on python-06.easyrencontre.com X-Spam-Level: X-Spam-Status: No, score=0.9 required=6.3 tests=ALL_TRUSTED,AWL, UNWANTED_LANGUAGE_BODY autolearn=disabled version=3.2.5 Received: from mail.easyflirt.com (localhost [127.0.0.1]) by mail.easyflirt.com (Postfix) with ESMTP id 4AC4F6375D5 for ; Thu, 16 Jul 2009 17:59:40 +0200 (CEST) Authentication-Results: mail.easyflirt.com; X-DKIM-Authentication-Results: none Received: from localhost (localhost [127.0.0.1]) by mail.easyflirt.com (Postfix) with ESMTP for ; Thu, 16 Jul 2009 17:59:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.easyflirt.com Received: from mail.easyflirt.com ([127.0.0.1]) by localhost (mail.easyflirt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q2T+pKLQL5OZ for ; Thu, 16 Jul 2009 17:59:40 +0200 (CEST) Received: from [127.0.0.1] (office.easyrencontre.com [78.155.152.6]) by mail.easyflirt.com (Postfix) with ESMTPA id 21BA9637594 for ; Thu, 16 Jul 2009 17:59:40 +0200 (CEST) Message-ID: <4A5F4E69.4010209@easyflirt.com> Date: Thu, 16 Jul 2009 17:59:37 +0200 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Unset semantic on instance var From: mathieu.suen@easyflirt.com (Mathieu Suen) Hi, try: _______ class A { protected $a; public function __construct() { if(!isset($this->a)) { $this->a = 'd'; echo '1st'; } unset($this->a); if(!isset($this->a)) { $this->a = 'g'; echo '2nd'; } } public function __set($columnName, $value) { echo 'New value : ' . $value . ' for '. $columnName; } } new A(); ______ unset mean removing the instance variable from the class!! I was using the lazy initialisation with the isset function but then now I will initalize all inst var with null and check with the is_null function. Would it be possible to have inst var null by default insthead of a pseudo unset/null variable. Thanks Cheers - Mathieu Suen