Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60356 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44111 invoked from network); 28 Apr 2012 22:16:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2012 22:16:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:51792] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/87-06766-02C6C9F4 for ; Sat, 28 Apr 2012 18:16:01 -0400 Received: by lahl5 with SMTP id l5so1276772lah.29 for ; Sat, 28 Apr 2012 15:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ufhkS6BBY9/FDM4jcJtg4BuGH5egNjb7qX+XyGT5Ruw=; b=IJmM5r4rTuZ7r0LYMn/qBhqvmAFig1LmycJFXzxD4PpflU9E5Eo9d0815UMfJeuR2s vvW+zK4DgNRoHrwmM1h9j/6oUDIgvqQbufRCm4pw+jbAdEUbzK1JuehqYJSEL/AFBdZk VlaO461mW4lNJDBUJ00lf8vmYFCbroUrNcN0qS2Nuac81jONTeCVy2zOHOSEGMQslcIC V75b/I7BcqSH8KYhqjlSOHykl/e/EUMsLJGX6WzmBy9BjkWH0XBTJ1vkGByEYuokPRQh W+QLiJePddXYZCyGzaL1L3yKUg95YtepYQTPsrO2I8HQF72Tdn4QwMEyQj+8VX+GImaR ZtXQ== MIME-Version: 1.0 Received: by 10.112.86.34 with SMTP id m2mr7719553lbz.38.1335651357236; Sat, 28 Apr 2012 15:15:57 -0700 (PDT) Received: by 10.152.1.196 with HTTP; Sat, 28 Apr 2012 15:15:57 -0700 (PDT) In-Reply-To: References: Date: Sun, 29 Apr 2012 00:15:57 +0200 Message-ID: To: Yader Hernandez Cc: jpauli , Laruence , PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] call user defined function with args From: nikita.ppv@googlemail.com (Nikita Popov) On Sat, Apr 28, 2012 at 11:49 PM, Yader Hernandez wrote: > I had a look at > http://lxr.php.net/opengrok/xref/PHP_5_4/ext/standard/basic_functions.c#4714 > and > I don't understand how it's passing the arguments into the closure given by > the user. > > I can successfully call the closure given, but passing arguments into the > closure is something I'm not clear on. > > Can someone please shed some light? Look at the zend_parse_parameters call. It fetches the params into fci.params and their number into fci.param_count. zend_fcall_info.params is defined as zval***, so it's basically an array of zval**. So you simply have to create one with your arguments :) Hope that helps, Nikita