Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46472 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89569 invoked from network); 19 Dec 2009 01:00:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2009 01:00:41 -0000 Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 148.87.113.124 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 148.87.113.124 rcsinet12.oracle.com Linux 2.6 Received: from [148.87.113.124] ([148.87.113.124:19050] helo=rcsinet12.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/83-63064-7B52C2B4 for ; Fri, 18 Dec 2009 20:00:40 -0500 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id nBJ10XX1027423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 19 Dec 2009 01:00:35 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rcsinet15.oracle.com (Switch-3.4.1/Switch-3.4.1) with ESMTP id nBIMMIg7015461; Sat, 19 Dec 2009 01:00:29 GMT Received: from abhmt003.oracle.com by acsmt355.oracle.com with ESMTP id 1122076691261184401; Fri, 18 Dec 2009 17:00:01 -0800 Received: from [141.144.168.132] (/141.144.168.132) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Dec 2009 17:00:00 -0800 Message-ID: <4B2C258E.9060106@oracle.com> Date: Fri, 18 Dec 2009 16:59:58 -0800 User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Johannes Mueller CC: internals@lists.php.net References: <83.E2.63064.C512C2B4@pb1.pair.com> In-Reply-To: <83.E2.63064.C512C2B4@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Auth-Type: Internal IP X-Source-IP: rcsinet15.oracle.com [148.87.113.117] X-CT-RefId: str=0001.0A090207.4B2C25B3.0085:SCFMA4539811,ss=1,fgs=0 Subject: Re: [PHP-DEV] is_a() versus instanceof From: christopher.jones@oracle.com (Christopher Jones) Johannes Mueller wrote: > if(is_a($foo, bar)){ > .. > } > // runs with an undefined constant bar notification > > I think the instanceof solution can cause problems, because you can not > trigger the problem. What do you think? I think you meant: if(is_a($foo, "bar")){ since is_a() takes a string as the second parameter. Does this correction then reset your expectation about instanceof? Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd