Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48462 invoked from network); 22 Jun 2016 14:06:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2016 14:06:59 -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 207.46.100.128 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.128 mail-by2on0128.outbound.protection.outlook.com Received: from [207.46.100.128] ([207.46.100.128:53110] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/00-43024-E7B9A675 for ; Wed, 22 Jun 2016 10:06:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fgx9ZRsuVaGJVXaIuPZbqjMxeqyLp0VpnY6aLOqGGJg=; b=RgJFsxbt98pn9NI/BpJYmJAyUQnVbsFDCMfuCEwXa6h1ZeD0tvPnUCF501vl8IZl+81kLUJvifp6eWAL6+hdLO45DZnasvS8JukBnU2U9nl2PWIQBTkB6ZZanHz2R8udqXn5TgoM/F9itvPmcba0UEc4VVdhF5GMFJ5qROeqIqo= Received: from BY2PR0201MB1784.namprd02.prod.outlook.com (10.163.72.26) by BY2PR0201MB1798.namprd02.prod.outlook.com (10.163.72.28) with Microsoft SMTP Server (TLS) id 15.1.523.12; Wed, 22 Jun 2016 14:06:49 +0000 Received: from BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) by BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) with mapi id 15.01.0523.015; Wed, 22 Jun 2016 14:06:49 +0000 To: Nikita Popov CC: Nikita Popov , Oz Gilat , PHP internals Thread-Topic: Fixing backtraces with custom get_class_name() handler Thread-Index: AQHRzIem25poCEpqDkO/QDc2QA0eZJ/1e2kAgAAIrys= Date: Wed, 22 Jun 2016 14:06:49 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dmitry@zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: b8d67268-f81e-4559-93f3-08d39aa67443 x-microsoft-exchange-diagnostics: 1;BY2PR0201MB1798;6:6fXiXwxx0bQoYjLXBAw+IXZnYj2JEePiGjCE+6PkUavItAwOaqKKxzc8rZVx0cgHH5K1by/yJ9XPJIRrNSw/OElv6qruyfQE2PTplcPPe4Bgy9hWlFOqzq9tNk2DTipLgu8fjWhIH1DbZDBvsJDPXIkMNZXm/bAsvNIN80bWWD3ZJjFfbdmEXsZvKqyrfSXX2nmzudLFBYKFmTGIu11tRf3Tq7Q0cLPLXh0KKNENv1AkMbWrQLH8kXfQNjYeFk3r6LNGH7kFMlr0FkxHv6IfO2dnCcsYz31TOpHB258KThKY5opzBs4yaBVfv9eL7lo9;5:liX/OwQqrhAJvKrplPoZAi2kwuRkhiq8l72ZU8QwqhNidOOmDD37EUXwLs0ijaO4kbAq6BomhowvUgO9rSAD7dyDyS3BjR082jQNwF+Ux6XgLkSyQg3plUaEV9X7C/QSClVRDaEURqNxk/UugGeL9g==;24:PyXazPNFb7LgbLstnvTubgJWxrnb4M3xRMIQzGZqcHwnuTQZXXSHOLuHvDey2L0hvKNUSk++YFwq6e6mLjTIqPeNMIkS7feHeE0X1QEE4dA=;7:2XwNGMr7bFbulltzi69mlhF2qnFc7gtmcjIEyEtfgHHTJuEgKZCaE1smE0DWaecMJjtbPFIyAYw5CizbijLmUpeovzL1nHQhEFku7E7ayK+fHy/GuCxc/UOBNr9YIlIwDwJQ4OKvA6iD2TbhQdp6z6IF4jEUs5wusPCOM/Bdt31u1GbCukWF0TzqMn8AI+iGzOfp91d8prkdnkBcNP08fKVm/nEfS49tSpoJKrwT1reISRz+UO9nSLIO3VA9PXJjIPvKCpy8oPiNT5aOnIenRw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1798; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(166708455590820)(192278398808882); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:BY2PR0201MB1798;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1798; x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(7916002)(24454002)(76104003)(189002)(52314003)(377454003)(199003)(87936001)(3660700001)(101416001)(2900100001)(77096005)(6116002)(19617315012)(102836003)(106116001)(33656002)(81166006)(3846002)(50986999)(105586002)(99286002)(19580405001)(3280700002)(7846002)(19625215002)(54356999)(81156014)(5003600100003)(92566002)(7736002)(2950100001)(5002640100001)(16236675004)(7906002)(15975445007)(76176999)(189998001)(2906002)(122556002)(68736007)(19580395003)(8936002)(4326007)(106356001)(9686002)(11100500001)(86362001)(66066001)(10400500002)(19627405001)(97736004)(74316001)(575784001)(110136002)(76576001)(586003)(7696003)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0201MB1798;H:BY2PR0201MB1784.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BY2PR0201MB1784F6DD6CD7E174C19ACA59BF2C0BY2PR0201MB1784_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2016 14:06:49.1442 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1798 Subject: Re: Fixing backtraces with custom get_class_name() handler From: dmitry@zend.com (Dmitry Stogov) --_000_BY2PR0201MB1784F6DD6CD7E174C19ACA59BF2C0BY2PR0201MB1784_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable get_class() returned some decorated name. anyway, fixing backtrace is already good. Thanks. Dmitry. ________________________________ From: Nikita Popov Sent: Wednesday, June 22, 2016 4:30:26 PM To: Dmitry Stogov Cc: Nikita Popov; Oz Gilat; PHP internals Subject: Re: Fixing backtraces with custom get_class_name() handler 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 si= mple obj->ce->name reading. However, this functionality was used by some 3-rd part extensions (e.g. Zen= d JavaBridge and may be pecl/perl). These extensions create proxy classes and control remote objects through RP= C. 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_cla= ss(), 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_d= ump() etc Oz, as I understood, you already found a workaround for get_class/get_paren= t_class introducing get_java_class(). right? so, do you think it worth to fix get_class/get_parent_class in 7.1? (I thin= k 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 ho= w that is supposed to work / how it worked in PHP 5.x. Doesn't replacing th= ose class names break any code using get_class() for anything other than di= splay purposes? E.g. $class =3D get_class($obj); new $class; wouldn't work,= because the returned name isn't the actual name of the class. Nikita --_000_BY2PR0201MB1784F6DD6CD7E174C19ACA59BF2C0BY2PR0201MB1784_--