Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52942 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99462 invoked from network); 5 Jun 2011 16:21:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2011 16:21:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pw0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:58212] helo=mail-pw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/11-26000-61DABED4 for ; Sun, 05 Jun 2011 12:21:42 -0400 Received: by pwj3 with SMTP id 3so1826069pwj.29 for ; Sun, 05 Jun 2011 09:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Y4CZQN37mYqFlZGPDkTMmoqbnMkLyC0lgU3xGVFLsI0=; b=f3FNvFsTzFHu6ryfb0gScBHmFf9wWJdkKDBnLm01w9eFnB/eXleSnzg6itLFPQxD4/ 5/mZxL95R5WEZ9rrf4Jm9/mbcDGQ30qEtgHZrmYrzljEXG2Ucov+apnc7ri+Tf3775bf xRmchJz2eHsjzQuG8QwmOk7Yu5WuSWp/9hJRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=uV6ISzDLju2ewV02AAfonM331c6CZY1nEoVYZdNaxiK1OGF/wdF5MviV7IM8IfkNV/ KKmus1A8fksES8ZBN8SCZZRgqGFgZBEs8Z4Y1tyZkjMw3M9xxkwTbolk2PRLTwSBOBHq YLS+P06JUUcdrcpenSEUv+5zE2Wvd4MkYZl0A= Received: by 10.142.204.19 with SMTP id b19mr624009wfg.62.1307290899161; Sun, 05 Jun 2011 09:21:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.246.21 with HTTP; Sun, 5 Jun 2011 09:21:19 -0700 (PDT) In-Reply-To: <20110605175759.61a11a4a@benny-pc> References: <20110605175759.61a11a4a@benny-pc> Date: Sun, 5 Jun 2011 13:21:19 -0300 Message-ID: To: Benjamin Eberlei Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=000e0cd32f30a9a1c104a4f9618d Subject: Re: [PHP-DEV] $arr = array('Hello', 'world'); $arr(); From: felipensp@gmail.com (Felipe Pena) --000e0cd32f30a9a1c104a4f9618d Content-Type: text/plain; charset=UTF-8 2011/6/5 Benjamin Eberlei > That can lead to quite a bit of simplifications in code where you now have > to check for is_array/is_callable/instanceof Closure and such. I like it. > > Exactly, and since our current $x = 'hello::world'; $x(); doesn't support method calls, the array one can help on this just like the call_user_func() approach with arrays. $callback) { if (is_callable($callback)) { $callback($k); } } Output: Hello, 0 Hello, 1 Hello, 2 -- Regards, Felipe Pena --000e0cd32f30a9a1c104a4f9618d--