Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67302 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88872 invoked from network); 4 May 2013 14:33:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2013 14:33:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.161.171 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.161.171 mail-gg0-f171.google.com Received: from [209.85.161.171] ([209.85.161.171:61789] helo=mail-gg0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/CD-26044-75C15815 for ; Sat, 04 May 2013 10:33:59 -0400 Received: by mail-gg0-f171.google.com with SMTP id r4so391170ggn.16 for ; Sat, 04 May 2013 07:33:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=GI7II2dmZkgrZUB/4RNo5iEMcAj/h5rxo0rCRmp7PIs=; b=RrD8B38sDsgTtaNZcGzzDkYZOLIZEhH3i2GSG4su79S7IxZLunEUlQA3pbHzCu1SvI sYV6h85qppp+Lk3lD1SUzUAfMmS3QSiGkHm+h/BBPInERzXvSUwYIiOLb6nzEJrBhUFs zvw9XNYt2V5pE0YpW0gRc/8CXHJbHhl8o4wZoaO3nK3zOI6GrqnqilF0+xcN1JFrVobF PwfXLbHMxnI4Q+yzifMlWGJav5gqzhH/Vab655TLEsTlTWr66WQkVG1iEIgHros/urB3 31zrbvvhQLO8RL8mavBSJcBsD7BYGfhrlXvJF3foVsLewj5u1ai3ou+yey48yWGmHM3m 3+IA== X-Received: by 10.236.114.5 with SMTP id b5mr12764637yhh.120.1367678036056; Sat, 04 May 2013 07:33:56 -0700 (PDT) Received: from [192.168.5.201] (ip-64-134-231-241.public.wayport.net. [64.134.231.241]) by mx.google.com with ESMTPSA id c31sm14174815yhn.6.2013.05.04.07.33.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 04 May 2013 07:33:55 -0700 (PDT) Message-ID: <51851C3B.9040607@lerdorf.com> Date: Sat, 04 May 2013 08:33:31 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: Laruence CC: Anthony Ferrara , Nikita Popov , PHP Internals References: In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQl6MynWsW8CtYW5xIyYdnv78XpBC1T/2fpx+Ox43KarG3227LKEBZT736WTcp867npPN1JT Subject: Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback From: rasmus@lerdorf.com (Rasmus Lerdorf) On 05/04/2013 08:28 AM, Laruence wrote: > and inefficent not always means performance only, in this case , you > need to define various functions for different regexs if you use loop style. > > and do you prefer array_walk or foreach when you try to iteraterly > process an array? I certainly prefer foreach over array_walk/array_map because I think the resulting code is easier to read. It also happens to be faster to use foreach in every case I have ever tested. -Rasmus