Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110727 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16249 invoked from network); 25 Jun 2020 14:46:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jun 2020 14:46:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 21B5F1804C2 for ; Thu, 25 Jun 2020 06:34:12 -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=-1.9 required=5.0 tests=BAYES_00,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_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2044.outbound.protection.outlook.com [40.92.18.44]) (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 ; Thu, 25 Jun 2020 06:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvCxD9n5Jiueh8/VVXRWucOtPoInj36H653vVpHSrbFT87n0OVXgpKApSv3CvSQegHYV2fPhxQDtT8gSr8L1tIYgDds+HuD9Nc933xR/8z1gwi8flGdajSt/bPU1csJr5OIW+7zyhGGVWWz79byFcdxDnS+MT/IChaQpd1XbEaQ08BwLP9E1g5jysVqVDr58zZeVSZcIKemcZWsXkl7islkWiiT4dEs58OFwwPoGH8gv0IW9U3Rgs30uc6zYWKJk+xQX/BLEwAkeHphl2i28FijgdVzVmnNS9ep7yczMP7+QX8E8/Mmdp7+b8ZlXeJlheMntvF/Oet7p2Pxj8eKryg== 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=up+w3hy35aOInvrtgw54INVnygUFV+yWhIPdm7qi7mg=; b=FqtSal+Jgdf3ngnkQKpMO/AxmEbU1+6EbeeXX6GbSkAvwax78d5pmsMayFLICyFr+1aHBoFrCQmFKBPFBW7AVO9X3AWMaoT0XTpayq4zG/70vDNofv3eXvQTTvfrdCE/kQ0hDC8VcHVRQQzQxjwlnedBLygZe+klzNrgfUBWniEw/bEGsHAL/6zJHdHX6xDjGt678ICbfi+WZSLrQPKyfYzoANJ/PijvyY9a7U3sW4SYCtfKgBuzLpRy4kJyTTEq1Txh80I9W9iw1MjnxEaOJPu+UbHrvLMSFYqDmml59KQzV4uA1NLMpPd6QcsJRKyO313ZcgBMxpX4DOqCj2XaQw== 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=up+w3hy35aOInvrtgw54INVnygUFV+yWhIPdm7qi7mg=; b=t6Gd0NNAHGnIYqprGGCZk8MOcvk3SxLvai6Cuj9xALP7QYB2nDdBgFH2XRZ4VwdkodZwiWhwkezXFJ56gSmhD9HMhdytAQIeZRLpRB6BBDMdtZnyclEnyKAVD/RvNjRFR9XgmRG/baM740TBDDUiosopazbd5ZE5kbNxkcSvJUuOhhtwSIHPde0oXixXgDTRssBTcnL3gs+sXseuqFXji/E8p+7GaS8sPweqziRx4Ng7XC2p8USmnXYbZO+TvHjWndRrUCqK3I+cl8thvLokakrb6UwaCEgqOP9OvZi0Kufbjfn9+bTueuwL+fZqzt+JzedPf2pFloWsf9OQGNMR6g== Received: from DM6NAM11FT037.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::48) by DM6NAM11HT234.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::428) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Thu, 25 Jun 2020 13:34:10 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc4d::49) by DM6NAM11FT037.mail.protection.outlook.com (2a01:111:e400:fc4d::122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Thu, 25 Jun 2020 13:34:10 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::f0c8:f413:c7c1:e934]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::f0c8:f413:c7c1:e934%4]) with mapi id 15.20.3109.027; Thu, 25 Jun 2020 13:34:10 +0000 To: Alex , Ryan Jentzsch CC: Internals Thread-Topic: [PHP-DEV] Making the hardcoded string length limit of Throwable->getTraceAsString() configurable Thread-Index: AQHWSluH9mWyvPhluEKGvr5yJRT+2qjomMgAgABMqwCAAG6xPA== Date: Thu, 25 Jun 2020 13:34:10 +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:C7A91A08E56F1312B5996770A4871F8FB6B2CEED785755EFD9585CE424D74F9E;UpperCasedChecksum:847AF4F1DFBEE5E25AAC846DD8248FE80716322D12024CB1E11F90750040D4BC;SizeAsReceived:7379;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [i1FSJ561HlU8h3a83kt+ePmad7rwFKIGUndvD8t4wR/CYUYfNvcJr0cVv8lmyUnK] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: a5d841a4-009f-41e7-1d49-08d8190c712f x-ms-traffictypediagnostic: DM6NAM11HT234: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nP8tb54/6vxzsPWKz7O5UZdchGgVfSc7NtL2w9ovYRLoeOF2VA+4SwE80LUiPyHNbMUXkfN6rFb8dwhQ7F+v8ESTQ6JWjXCO16+gWL0vP5nVQs/1wpBX41A4TnF/SOzcFb+GU8KaAc896P2FoO1Bq8pY+j5NwxW3oHM4cspQkQA61bFGI9D+RniRmxsfmrJNZk+EDILOXDuerRKHHy6mqTJWkeuiNm00iUqA3LN7hncvjpvjerpG7GQ3cIdHJYR9 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR07MB6618.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: 3mU2SjhVIwuhGI1tNMVtrzKXrXMAbBY9X+iZwsPj1qlTNxAUsSZWggeiXYdMhkqzbT+KYwvYkbFmL6EsyXY7T3rs4oTgZliqk3KgixeWs3wFCDQbETwoKXNcIAoyQl0ry6FARty991A+zWA2BwXbsIb6BkAzJXusaElKLANfcsKPgK3bg0hrFEZAVgiJobh/tNN6PIqYS7pTh4lgBhnvOw== 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: DM6NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a5d841a4-009f-41e7-1d49-08d8190c712f X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jun 2020 13:34:10.1720 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT234 Subject: Re: [PHP-DEV] Making the hardcoded string length limit of Throwable->getTraceAsString() configurable From: tysonandre775@hotmail.com (tyson andre) > > Why is there a 15 byte limit in the first place?=0A= > =0A= > Presumably it might be so that multi-megabyte strings are not dumped=0A= > to the console when printing out a stack trace. (Disclaimer: I have=0A= > not touched the relevant code and am just guessing.)=0A= =0A= It apparently dates back to 2003, when exception::getTraceAsString() was fi= rst added.=0A= https://github.com/php/php-src/commit/c80eb4573f8cbc268463c7ec233b467bd9b36= b0f#diff-16cc0fb22dbf90c4c465180255880ea0R167=0A= Arguably, computers have more disk space and better processors.=0A= =0A= The reasons I can think of to keep a low default limit:=0A= - Syslogs might use udp for async logging, which has a limit of 4096 bytes = or so, which hasn't changed=0A= - Code might truncate before logging an exception, and shorter argument rep= resentations would allow logging more frames of the stack trace=0A= - Code might log exceptions to disk during abnormal events (e.g. network ou= tages), and too high of a default would fill up disks faster=0A= - CLI apps might fill up the entire screen or terminal scrollback buffer wi= th megabyte-long strings (e.g. `string $file_contents`)=0A= =0A= - Tyson=