Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94199 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44153 invoked from network); 22 Jun 2016 13:30:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2016 13:30:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.169 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.169 mail-yw0-f169.google.com Received: from [209.85.161.169] ([209.85.161.169:36738] helo=mail-yw0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/4F-43024-5F29A675 for ; Wed, 22 Jun 2016 09:30:30 -0400 Received: by mail-yw0-f169.google.com with SMTP id b72so42390860ywa.3 for ; Wed, 22 Jun 2016 06:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lBggJHyFJp6zEAV7PdPECBXElJOmcxE/xm+Zb8dk/vw=; b=Ctz/2ZI1SKlEI4vgni1v7lSqsjc8dLsDyu5Uf3HBb1c0KKCEYmu0V9zjGoVsjuSE2Z qZNl0xEJ3MJlQbdzceM3CgAUoRkWL5dCLjCRX4dmqyRKNX8hbP0ngpmTqjE9hk0np9kg 6x4mxSzThVSTk+m6MB7BEgHgAWzGVLnWR56aM6vbSfzxscFbiAF4wdyGJmHAHTtX04Am VDV4ws8+dg+w9WG6nV5CgureYXTolhezqlOYcHcugEHhx9dAvH1SzB8Mr8z28eUrLTxa UcQBUvS3fFPh3fVw3t0NvciauIkTckbVpSH4bDp/iEmnCCWBCDdNJwGLpekjynaofSNw 0/AQ== 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; bh=lBggJHyFJp6zEAV7PdPECBXElJOmcxE/xm+Zb8dk/vw=; b=hHPvvJVAVJlSsbQ2VWfiV9HcMWOnKFrQ8pwPD84LGnucZG5TbW2yqS93h2yUVDDIwj eC9q43o73ntr1AZn7lmSaquIUKrqLjUqMH6eEnGGP9NjSJWWJrAJCNK7I1oIpfZpRhA5 1VbWOSxlHUd6sETDkLUfC9qL6ltCLaQ+mOuozPnHF6xrAawNmY5I/YqdYL4GZKtj/2K3 yePG0aIkuD3Bqfuiley62EeXxyFFsxHaNwdDk4vigKEulJqWftU7/aOLx2XfjEMGovvV gYXNJTkDgXcroBz4QwSXRzlewk8Iu1Gn5X/ElyFQL9ycE2Zj0u5L3SH13oTJh1NX29V7 67nQ== X-Gm-Message-State: ALyK8tJm6GoMl5tp8ZpOlbwcIRYvhXPq6B1p+5KhS3OTlNncpO5x92H8hpqeIN2MZDoleJDhMDqCkSXP1eHJlA== X-Received: by 10.129.130.135 with SMTP id s129mr16386117ywf.139.1466602226660; Wed, 22 Jun 2016 06:30:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.242.129 with HTTP; Wed, 22 Jun 2016 06:30:26 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Jun 2016 15:30:26 +0200 Message-ID: To: Dmitry Stogov Cc: Nikita Popov , Oz Gilat , PHP internals Content-Type: multipart/alternative; boundary=94eb2c07b82abf593e0535ddf063 Subject: Re: Fixing backtraces with custom get_class_name() handler From: nikita.ppv@gmail.com (Nikita Popov) --94eb2c07b82abf593e0535ddf063 Content-Type: text/plain; charset=UTF-8 On Wed, Jun 22, 2016 at 3:14 PM, Dmitry Stogov wrote: > Hi Nikita, > > > When we developed php 7.0, we replaced most calls to get_class_name() by > simple obj->ce->name reading. > > However, this functionality was used by some 3-rd part extensions (e.g. > Zend JavaBridge and may be pecl/perl). > > These extensions create proxy classes and control remote objects through > RPC. > > Actually, we broke the previous behavior of backtrace* and > get_class()/get_parent_class() functions. > > > Backtrace may be fixed even in 7.0 with the following patch: > > > https://gist.github.com/dstogov/d84183da9b0d958dfe5cb8d711c8d677 > > > However, we can't fix get_parent_class(), because we changed > get_class_name() handler prototype (removed "parent" argument). > > get_class() may be fixed but I don't like to do this without > get_parent_class(), because they are going to be inconsistent. > > > What do you think about fixing backtrace in 7.0? > > In my opinion, it looks consistent with other "debug" functions, e.g. > var_dump() etc > > > Oz, as I understood, you already found a workaround for > get_class/get_parent_class introducing get_java_class(). right? > > so, do you think it worth to fix get_class/get_parent_class in 7.1? (I > think no) > > > Thanks. Dmitry. > Hey, changing debug backtrace to use the class name handler sounds fine. In 7.x we define it for use in "var_dump and other debugging functions", so using it in debug backtrace seems appropriate. I'm not sure about get_class/get_parent_class. I don't really understand how that is supposed to work / how it worked in PHP 5.x. Doesn't replacing those class names break any code using get_class() for anything other than display purposes? E.g. $class = get_class($obj); new $class; wouldn't work, because the returned name isn't the actual name of the class. Nikita --94eb2c07b82abf593e0535ddf063--