Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8564 invoked from network); 26 Feb 2013 15:39:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2013 15:39:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.223.176 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.223.176 mail-ie0-f176.google.com Received: from [209.85.223.176] ([209.85.223.176:48034] helo=mail-ie0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/C3-16132-E27DC215 for ; Tue, 26 Feb 2013 10:39:26 -0500 Received: by mail-ie0-f176.google.com with SMTP id k13so4508915iea.7 for ; Tue, 26 Feb 2013 07:39:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:x-originating-ip:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:x-gm-message-state; bh=MvK4om4NTp7f3wCrZa/8XVYOmZ9TFkwoy948rSmuNB4=; b=JzL7JJqOchlcNcRSQgwmAyHkvEwXpl/O/I0WfiKdQ5PZqs+nvZy2XV46VSvWpFH5tv 2RXm6G2O9IRpDr9RihIaLNimZXpL9Gv5SKL8U9Gkyj+lIpX6C1gMRUtKRahTMQUrgkdC QKKkgqni4KRS8lCejIhuBua6+K6TzYbtxwGb+DMYN1PT1IQw1xklLqwut8i+F+km0gkp eXgEhyVfLNk9vq3r9rgEtpp3M02LpMZnDGXkz9WYiXzWFA07byC+LlV+o2wlkBzxwCHH b63Ig98wru7Gf5LWDp65gNogLmn+VHanZF0GtFaVwwIl1qM4vFBsel6U7OAXPXdq0OMt Pzdg== MIME-Version: 1.0 X-Received: by 10.50.76.168 with SMTP id l8mr5541472igw.97.1361893163676; Tue, 26 Feb 2013 07:39:23 -0800 (PST) Sender: php@golemon.com Received: by 10.64.25.168 with HTTP; Tue, 26 Feb 2013 07:39:23 -0800 (PST) X-Originating-IP: [209.104.114.2] In-Reply-To: References: Date: Tue, 26 Feb 2013 07:39:23 -0800 X-Google-Sender-Auth: yBQjltze89aW8o1R5-oTgbYVgNM Message-ID: To: Nikita Popov Cc: Mike Willbanks , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmTvZgQeeNUh6YVvS3L6OvrcmcVD9ueDAbE98tCh/f/uG37lwFHezkKpQmMHFH8cS3C+E99 Subject: Re: [PHP-DEV] Add get_object_constants and get_class_constants From: pollita@php.net (Sara Golemon) >> Before drafting an RFC I would like to gauge interest in adding: >> get_object_constants and get_class_constants >> >> I have already drafted up a PR with the changes and supplemental data: >> https://github.com/php/php-src/pull/292 >> You took the time to make a PR, but not an RFC? This should really be the other way around (if at all). >> Currently this can only be done through ReflectionClass which is far slower >> than retrieving them directly from the constants table. Some simple >> timings show that through reflection retrieving these values is 2-3 times >> slower than providing a quick access function for retrieval. >> > I don't quite see why we need this. The only argument seems to be > performance and I'm not quite sure why performance would be relevant here. > At least I can't imagine in what kind of code fetching the class constants > is a bottleneck. > I'm meh on the perf issue. Yeah it's probably there, but it's buried in the noise and I'm not so sure about use-cases. Not against it for its own sake though. >> This also fits nicely amongst the current stack of: >> get_object_vars, get_class_vars and get_class_methods >> > Yay! Consistency! Boo! Poorly named get_*() methods should have been called something else from the get-go, but it's too late for that. Honestly, this is the bit that bugs me most. >> These functions are commonly asked about on areas such as StackOverflow ( >> >> http://stackoverflow.com/questions/956401/can-i-get-consts-defined-on-a-php-class >> ) >> amongst other places on the net. >> > I... kinda don't care about this part of the argument. It's called "Google", and if they can't find it in Reflection, they won't find it here. -Sara