Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85500 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54877 invoked from network); 27 Mar 2015 09:14:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2015 09:14:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:34013] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/92-38005-37F15155 for ; Fri, 27 Mar 2015 04:14:27 -0500 Received: by lagg8 with SMTP id g8so65517628lag.1 for ; Fri, 27 Mar 2015 02:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=36BuDPLEuDz8JUS7/eyFcgogFnTF7y9TsFkKviUg5Fg=; b=XLEX0RozjmHOUHhIJNjuvx8hMNu3r44chggZi3oMLaGVSiYEyiSPBLlCnZVTeJVGr6 7JazYh78mOMNLIqcm3D6ScXZGuryZnoWATL1Lzi321dtjplRW661wa8GVLyBbPp2b3xB MSQyFs9C6WlIsb7LhB0cca/uaAoiFAdw6DTJQR93VnHu1tLQhbzM3ntRlrSAhfID0c1K 3ezqqnFDPzqjuSNZdtFoXIqSt6eswzixN+CdnnCPjikV6uMLuKcv5mJQS/aMuI4V/jhp ZTVNjGLZrC7mFGa48nqG2I/Emoy8G5P0tqMF3+/KQIapDNXtL288n4UwSqzw4PUyYyz2 Ug6g== X-Gm-Message-State: ALoCoQnlEkFQsoQL8beQh0qvnHKvSu8PmIvJHIgwmKbbIiXWEfWhT6kdzfk1pmWk1LMDVWHqZ220ajjIKm+XBmWYMQTHlx1b9PynqJ7byiMpQ6wEz0X5s4Pk4fgcfIgy/ahz3BuxYIgopQcwsDRuK03NNUINc0qAgg== X-Received: by 10.112.25.38 with SMTP id z6mr17104514lbf.106.1427447663683; Fri, 27 Mar 2015 02:14:23 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPSA id s7sm183367las.44.2015.03.27.02.14.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 02:14:22 -0700 (PDT) Received: by labe2 with SMTP id e2so65437076lab.3 for ; Fri, 27 Mar 2015 02:14:21 -0700 (PDT) X-Received: by 10.112.51.35 with SMTP id h3mr16731475lbo.113.1427447661403; Fri, 27 Mar 2015 02:14:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.203.39 with HTTP; Fri, 27 Mar 2015 02:14:00 -0700 (PDT) In-Reply-To: References: <55142689.2080106@fedoraproject.org> Date: Fri, 27 Mar 2015 17:14:00 +0800 Message-ID: To: Dmitry Stogov Cc: Yasuo Ohgaki , Kalle Sommer Nielsen , Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] is_callable and function_exists with disable_functions From: laruence@php.net (Xinchen Hui) Hey: On Fri, Mar 27, 2015 at 5:02 PM, Dmitry Stogov wrote: > Unfortunately this id not so simple :( > > If we change class_exists() the following code will stop working > > if (!class_exists("SomeInternalClass")) { > class SomeInternalClass {} > } > ?> > > On the other hand function_exists() already behaves differently. (so > function_exists() and class_exists() are inconsistent) :( > Changing is_callable() semantic may be dangerous as well. > What is we disable strcmp() and then pass is as a callback to usort()? > too bad :< > > I wouldn't make any changes in hurry. this should be discussed and analysed > carefully. > > However preventing conversion of disabled functions into opcodes and their > optimization makes full sense. > okey, I will separate these part to a single fix thanks > Thanks. Dmitry. > > > > On Fri, Mar 27, 2015 at 9:41 AM, Xinchen Hui wrote: >> >> Hey: >> >> >> >> On Fri, Mar 27, 2015 at 1:14 PM, Yasuo Ohgaki wrote: >> > Hi all, >> > >> > On Fri, Mar 27, 2015 at 11:57 AM, Xinchen Hui wrote: >> >> >> >> On Fri, Mar 27, 2015 at 3:06 AM, Kalle Sommer Nielsen >> >> wrote: >> >> > Forgot to CC list >> >> > >> >> > >> >> > ---------- Forwarded message ---------- >> >> > From: Kalle Sommer Nielsen >> >> > Date: 2015-03-26 20:06 GMT+01:00 >> >> > Subject: Re: [PHP-DEV] is_callable and function_exists with >> >> > disable_functions >> >> > To: Remi Collet >> >> > >> >> > >> >> > 2015-03-26 16:32 GMT+01:00 Remi Collet : >> >> >>> do you mind if I change the current behavior of is_callable , to >> >> >>> return false on this case? >> >> >> >> >> >> Make sense >> >> >> >> >> >>> or, at least, change function_exists's behavior instead? >> >> >> >> >> >> Seems a bad idea. >> >> > >> >> > I agree with both points here, I think is_callable() should mimic >> >> > function_exists() behavior, is this the same case for >> >> > disable_classes? >> >> > >> >> yeah. but a little bit different >> >> >> >> class_exists return trun with disabled classes :< >> >> >> >> $ sapi/cli/php -d disable_classes=ArrayObject -r >> >> "var_dump(class_exists('arrayobject')); new ArrayObject(); " >> >> bool(true) >> >> PHP Warning: ArrayObject() has been disabled for security reasons in >> >> Command line code on line 1 >> >> >> >> Warning: ArrayObject() has been disabled for security reasons in >> >> Command line code on line 1 >> > >> > >> > Returning true for is_callable/class_exists even when it isn't usable >> > does >> > not make much sense. How about fix them all? >> >> I filed a bug here: https://bugs.php.net/bug.php?id=69315&thanks=4 >> >> will make a fix soon >> >> thanks >> > >> > Regards, >> > >> > -- >> > Yasuo Ohgaki >> > yohgaki@ohgaki.net >> > >> >> >> >> -- >> Xinchen Hui >> @Laruence >> http://www.laruence.com/ >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > -- Xinchen Hui @Laruence http://www.laruence.com/