Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85499 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52763 invoked from network); 27 Mar 2015 09:02:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2015 09:02:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.42 mail-yh0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:35512] helo=mail-yh0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/32-38005-6AC15155 for ; Fri, 27 Mar 2015 04:02:30 -0500 Received: by yhim52 with SMTP id m52so36852097yhi.2 for ; Fri, 27 Mar 2015 02:02:28 -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:date :message-id:subject:from:to:cc:content-type; bh=s25aeWUODrXNSzZXbFJEmINMKWX3ZDUeuzrb2QFvOZs=; b=fs6gl04v3g8Gr3rQegaBmPYXULxXMPe2HCprSDkigsbXYsYokep3N/9kU2J6kTsuml YPfrIE8xHmVC4LCJHsCVG7qzEIyhWSjZJk/GAIWJ5Qnje/95FQUYq714oU//h9Q6qMHF o/cVNUvYLlaP1YQhkF5hL3N1VhZD2E2GyXWH0HOO84VkXSMQYLi6ARBbRTIOwXkOOBSG A4yi5XRx1lJtqIVYS85vubHPGRroU1gLojTvBVPQFnE0BiKXD4vBc3Tet87J0Tv0X0aR n0iUJw9TAnbbgrQ4M9WRPDD9QNE53WpxhBS3MaQstSaCYbiEVXZp8h/zcif1F7tejanH vsVA== X-Gm-Message-State: ALoCoQnbdx94uaiVuYuY2Alwu8mOELK/7fpS1W3uQtr5U8251EuvKDziWtlJLMvjmUVeh1ODz4ouMIWVTADu9nHfh/wj3MKzNW0sbAGHjf0rdgg+2cQZXiu3adD/r1R8gukQim062pgcHiyaQCRBmDUmLnUp3q3oCw== MIME-Version: 1.0 X-Received: by 10.52.166.134 with SMTP id zg6mr21015801vdb.38.1427446947882; Fri, 27 Mar 2015 02:02:27 -0700 (PDT) Received: by 10.52.248.36 with HTTP; Fri, 27 Mar 2015 02:02:27 -0700 (PDT) In-Reply-To: References: <55142689.2080106@fedoraproject.org> Date: Fri, 27 Mar 2015 12:02:27 +0300 Message-ID: To: Xinchen Hui Cc: Yasuo Ohgaki , Kalle Sommer Nielsen , Internals Content-Type: multipart/alternative; boundary=089e01633ec443c0e505124164c3 Subject: Re: [PHP-DEV] is_callable and function_exists with disable_functions From: dmitry@zend.com (Dmitry Stogov) --089e01633ec443c0e505124164c3 Content-Type: text/plain; charset=UTF-8 Unfortunately this id not so simple :( If we change class_exists() the following code will stop working 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()? 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. 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 > > --089e01633ec443c0e505124164c3--