Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51239 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68079 invoked from network); 7 Jan 2011 09:33:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jan 2011 09:33:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=adi.nita@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=adi.nita@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: adi.nita@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:62919] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/26-25120-ADDD62D4 for ; Fri, 07 Jan 2011 04:33:14 -0500 Received: by iwn6 with SMTP id 6so18368733iwn.29 for ; Fri, 07 Jan 2011 01:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=88D5ZhrQmyxpM552oQZtpqOT7owajS8JZjYTYtylVfI=; b=GD7uBjrcOWvo3SSDWJ/LbmVWrZS/21CMWGe8IIC71vBH4P6no3g/30EZLJvoXiHnE6 22BhNZPeglDEx5Gq8j6RLbJlW41g5pxtNbMufpZ2i5zRDkcNPGtVZhEFhJWOW6vR83ST FvKL5jvrYFKmts0fVKp6WXXGfpF74CFOJAvGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=pFIqCQHggXYvJrQPNTE3EuxtpXoglhLBHKJEhbFRm9o1W/C/BNM7ayh4nXDSOeqpSF 5QDya51bFmYTT2NCwFkVitSjFZ9MGeNRhxXDGhMKu1PAeyrc2bz3GI29Jah4idvSEc8N A8QqvcxS/YsYoMLZ7Z04FldPirSY62DQ8biQo= MIME-Version: 1.0 Received: by 10.231.199.10 with SMTP id eq10mr25136846ibb.112.1294392792395; Fri, 07 Jan 2011 01:33:12 -0800 (PST) Received: by 10.231.213.130 with HTTP; Fri, 7 Jan 2011 01:33:12 -0800 (PST) In-Reply-To: <1294276068.10675.3.camel@guybrush> References: <1294276068.10675.3.camel@guybrush> Date: Fri, 7 Jan 2011 11:33:12 +0200 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Martin Scotta , internals@lists.php.net Content-Type: multipart/alternative; boundary=90e6ba4fc4c6972f6a04993e4e23 Subject: Re: [PHP-DEV] RFC: about class names as values From: adi.nita@gmail.com (Adi Nita) --90e6ba4fc4c6972f6a04993e4e23 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, To proper support this we'd have to make classes first class elements. > For making this consistent it would make sense to make functions first > class elements. And best drop the $ in front of variables and create a > new language. Everything else becomes a mess. > Closures are first-class citizens and it seems natural that they are so. Perhaps we should rethink what consistency means for PHP. I don't see any good reason why first-class objects could be evil, except that the $ could indeed be a problem. Regards, Adrian 2011/1/6 Johannes Schl=FCter > On Wed, 2011-01-05 at 21:53 -0300, Martin Scotta wrote: > > $obj =3D newInstance( MyClass ); // notice. undefined constant MyClass > > This describes the major change with your idea. > > What happens if a constant MyClass exists? > > Another question is something like this: > > function factory($class) { > return new $class(); > } > > factory( SomeClass ); > ?> > > > To proper support this we'd have to make classes first class elements. > For making this consistent it would make sense to make functions first > class elements. And best drop the $ in front of variables and create a > new language. Everything else becomes a mess. > > johannes > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --90e6ba4fc4c6972f6a04993e4e23--