Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113819 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63604 invoked from network); 27 Mar 2021 20:49:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Mar 2021 20:49:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BD1DC1804D0 for ; Sat, 27 Mar 2021 13:46:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08olkn2061.outbound.protection.outlook.com [40.92.45.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 27 Mar 2021 13:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EfsFZPNkg1ghg1nYDvl9sFuptioEZ1EWm5n5Pv9ILcp2yWtq6HSgl+uGKUSM2zgBigx66+tJnp6FLVFKyyuYrb/nlBLnRX9nutoOp0JjVglvFB6XA2OSbov8KQsy5jvYHXjqELJwjp6eSuM7m/PtVu/4O21e3jhXoPjD1V1G1UW9G0K7bA2H2yus07y/zlre0PmLidhfBvl+kGf4B2DO9OAivuavYDHL4UyHBNtzaU9/WTgFzpsXYoeDaz7OPaC35fVivNMy/AVVtnpyvOCtZTJicChFPFcK9kvOCx1jdKc+ZOeaaBH/N77mS1EyZHtc7p7LoS4QT2N80Yz7DJ3HLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BDAKMsZAGJ2CU0CQnfUJkanGTgACwYrGzA3eAwNCSdg=; b=JlyjYlatVX8VJZCzYmBPPY1ZTG/lNHF7OlEFesJcjBvvtlg4eRc73BGdM8jQtOiR/JM9huFVJtLS0knw+5VGBYoxX1D3i3JsXtJdyn8lmj8t7RU6l/1aLtJAm6wqgVmUNSVLqh3fULLGuBUBhDG76uU5ukLYtZM461KnI4pHhSXqj8DFl8KAexXYqO4k1TyfvTjRvIwdAnyunFR1Cj8/zXSf9Yj0Yl+I2BNqLlU/laTaPsU5zZRotdvGlScWzCG/4ENCt/7zZNUTgzGodnir0kstR5P6Ws/DvmKq2epyOAXSJLCu/Ud39xJhT/cRjhoWYcIhpPx4k1dUFnfgNvxF9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BDAKMsZAGJ2CU0CQnfUJkanGTgACwYrGzA3eAwNCSdg=; b=bbb+YS7oUYdWVxkTmEIVLD7UM6uXcMFb9G6ttq1BeT1+g6pjU5uimF7DJ5G7YCLCNZOh8nsVWI/vh8fe+semnLZ+6eFS1O7jt6c9htgTjGrtGJynqjQkpJNgHrP7MsTKBlt/4y/bVrYmrtCk6DIBgacKRGGQrfWHYpqYa0zHQ+7ceEa6Uf8lQCH5KrQ6YH+YvA7cmHS5rS6BVU/m3lv1vbJt52ZHVHL2tv62OVC0oaFqgsKftqZdGibnWIOXeEXIeIue39Nzfwpiy9Jyj7sDEak+ZWOjG6Aeik2bXddfRrMu+Kb3XPPVSRFLeKr2yxUAo/QMOLK6N6AZJioM+M1BOg== Received: from SN1NAM04FT012.eop-NAM04.prod.protection.outlook.com (10.152.88.52) by SN1NAM04HT236.eop-NAM04.prod.protection.outlook.com (10.152.89.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Sat, 27 Mar 2021 20:45:59 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e4c::53) by SN1NAM04FT012.mail.protection.outlook.com (2a01:111:e400:7e4c::109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Sat, 27 Mar 2021 20:45:59 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::9c7c:2273:6416:6a0b]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::9c7c:2273:6416:6a0b%6]) with mapi id 15.20.3933.038; Sat, 27 Mar 2021 20:45:59 +0000 To: "internals@lists.php.net" Thread-Topic: [RFC] debug_backtrace_depth(int $limit=0): int Thread-Index: AQHXGCztYduoyml/ukG33t46pHkGdqqYY0Yt Date: Sat, 27 Mar 2021 20:45:59 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:1F7A4E1D02CA74E5ECCF3B5E7DE41978E1EBDFADE8CADB813597E41C5729C726;UpperCasedChecksum:26446778C879BDC465FEAC673C8AA6EBB0CB6F3BCAB1607EB1280322A25D4C10;SizeAsReceived:7055;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [qP92VwZKrZ7MXqzwWqGwuNmFQaj1H6RHfYqLcCWT3T2O2dbAs3pbEI9NAMo3f172] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 835fb396-399a-4cbd-77a2-08d8f16153cf x-ms-traffictypediagnostic: SN1NAM04HT236: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CD2dZg39AzwywIOQK1uFBc8XMfBbg6IBRLZshJmKwdL1PI1QJfcbe7r3JUCKjD7J7l4kNqS2yZ28pekmjXU0JaKc2exLVmwuHnPmJfmN8aCEXBBfCoIz6PnPmqu12GDDbiAYtWhpp41W0A1vlu2CeqEjBtDPoospqQL26WBzQvqKILFNNtK4mh6IXVv0XmdyY9ggELVZDLTgJZ+qiEDi7h4DMZPcSdnohlzrejBE3ZKxaX717XoNwDATEqNDe9OR4cI4Jk+ZVxqp9uCENwY/d//YQr7M3iXyi6QdIbV6l4bQM3TkB+dx+EZbiwbW3cZIkYVndX9DsKYL8gYG1yBJhmb6AfKoChtH5sB30dvVkl/uUVrIbZ4SaLl3wlM5zguX2GmmN9EzHqAh143VbNgZfpQyeOXd+Cs2hBs7D2KjoNXyUkzqHbskDm5P+TfjEQvJ x-ms-exchange-antispam-messagedata: 6mJ2DbVq4jTIuk+4t/2xVe+RmgQ41z/PTFAafAygY7B6j2ztkicFaVyJFps6ZwWl/9HL2oJpmtcamB1fbw7H+XL94sPgFFtXYlWgsOg3dLps7LBeIYw/Db/1wd3/EkEYJjp3UhXxf3qxpomJ5w8B8FG3W4qfUWR9osBfe+xIhe0QV5V5YxDBiAaeRVsNtQjpULAs+p+O2PBBnjet3LGJ2A== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: SN1NAM04FT012.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 835fb396-399a-4cbd-77a2-08d8f16153cf X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2021 20:45:59.2472 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM04HT236 Subject: Re: [RFC] debug_backtrace_depth(int $limit=0): int From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= > I've created a new RFC https://wiki.php.net/rfc/debug_backtrace_depth to = return the depth of the current stack trace.=0A= > =0A= > Inspecting the current stack trace depth is occasionally useful for=0A= > 1. Manually debugging with temporary debug statements=0A= > 2. Checking for potential infinite recursion or investigating reproducibl= e reports of infinite recursion=0A= > 3. Checking if code is likely to hit stack frame limits when run in envir= onments using extensions such as Xdebug=0A= > =A0=A0=A0 (https://xdebug.org/docs/all_settings#max_nesting_level , which= also checks for potential infinite recursion)=0A= > =A0=A0=A0 (note that Xdebug is a debugger - running php under xdebug is s= ignificantly slower than without Xdebug)=0A= > =0A= > It is currently possible to compute the depth through `count(debug_backtr= ace(DEBUG_BACKTRACE_IGNORE_ARGS, $limit=3D0))`,=0A= > but this is verbose, inefficient, and harder to read compared to returnin= g the depth directly.=0A= > =0A= > Thoughts?=0A= =0A= I plan to start voting on https://wiki.php.net/rfc/debug_backtrace_depth to= morrow.=0A= =0A= Thanks,=0A= Tyson=