Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62453 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24803 invoked from network); 24 Aug 2012 17:06:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2012 17:06:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.214.170 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:62302] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/00-24287-0B4B7305 for ; Fri, 24 Aug 2012 13:06:56 -0400 Received: by obbwc18 with SMTP id wc18so5331842obb.29 for ; Fri, 24 Aug 2012 10:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=nwUpeNs0lelzExfrvJuPcNVoumo/AyRPZ/Qzu+Q4/I8=; b=oNjoEnQqA0gO9dM6uwooqKRmf/aJll5OkJxptNMHnjLbdQ3/9SAydOjRCxJPC4ObSI 89x1dsWX3c3ZpSTX+aBLB6Fc596nu5Ij59x8wK65LCcJxacQXg8O12KBxmxmmIg3gjkW NndTBZs7V17B416SM6eJF30gdjplpGDBNPdZ2wqzVWx2znXqbX9lxAm0aH0LlWK6wEaa Y4TT2nL3KYx52dPuHoFaZXrVZIdptd6+azjq5Rb4miSZBJDwfrDdM4ASRZ3PPYOSWuxL B3kwpKgMJMcSQLxvmS8K5QxiTrrlQvho1M+6kbEI1i7eEyCLJLgn+LkZdgyK+3iElOc6 /o7Q== Received: by 10.182.124.102 with SMTP id mh6mr4463399obb.48.1345828012986; Fri, 24 Aug 2012 10:06:52 -0700 (PDT) Received: from Ralphs-Mac-Pro.local (ip174-73-14-247.no.no.cox.net. [174.73.14.247]) by mx.google.com with ESMTPS id e9sm7175273oee.12.2012.08.24.10.06.49 (version=SSLv3 cipher=OTHER); Fri, 24 Aug 2012 10:06:49 -0700 (PDT) Message-ID: <5037B4A9.9090309@ralphschindler.com> Date: Fri, 24 Aug 2012 12:06:49 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Yahav Gindi Bar CC: internals@lists.php.net References: <50368E58.9080606@ralphschindler.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk9Rn88KXR0xBLfpY8YKrBhVSCER0GHMP6qRFNQymcV8I6nqiuyX/tKINf+6MIcZgOlPXWV Subject: Re: [PHP-DEV] Aspect Oriented Programming in PHP From: ralph@ralphschindler.com (Ralph Schindler) > In addition, I think that the hook syntax has to be changed into the > "call_user_func" one (instead of... "$obj->foo()" do array($obj, 'foo') ) I think the current syntax is fine. Keep in mind, you can use wildcards in that syntax, I do in my application, for example: // before all controller actions aop_add_before( 'MySite\Controller\UserController->*Action()', array($this, 'adviseUserController') ); Also, the object has not been created yet (there is no $obj), but I know I want to catch particular objects by a particular type. I do not know what currently happens if I keyed on an instanceof instead of an exact type. I don't think you can successfully translate a wildcard match to a callable array and have the same meaning conveyed as clearly. What I don't want is a more complex syntax than that is already supported. -ralph