Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113099 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97900 invoked from network); 6 Feb 2021 00:54:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Feb 2021 00:54:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4CA29180089 for ; Fri, 5 Feb 2021 16:38:24 -0800 (PST) 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.0 required=5.0 tests=BAYES_40,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-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2034.outbound.protection.outlook.com [40.92.47.34]) (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 ; Fri, 5 Feb 2021 16:38:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8dolMfNwuWnR+NFNPpFyHC+GgQXNwqLNxdf+0zIEBzScOvK+qHnyuUlcC22DlUr4clG9A9gNXfVG8l2V3vyiJ57B0ZR28QFJzDEVH5tutDcr9+A/yi4ov1FYodxLQi3Tm7C4pe+Ot8Be6pqdg17UTuAwBl5ebbhOeHXiNv1c+a59/uhiBRY39BeFlG/Fy00HwGU43sVEJzeSB3iBu9wBfnFDZCI2IlYgLEGhAe5hoQOYWcsIwtkraf7fsG5nEw4cv41wjcfCM+fk9SwYP5d+jnGUG/YEcV7HOx37U8yR3iJlzpi+Gyfg8TtrwlZF5zEUIUpL+yImXruBJbUJdmjVA== 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=MonK86NpvtlHHdQzY5B74Qko76adGrhdw0rMGGuXzrw=; b=QCVD8b1SM5Y4hvqY/BKN5+DVJfk5qg1ktkBR+7iO86O1fqg6U9EyQshqTbTTk0fMUWQXtTrB2CFCnZTLHpE1HsAh2vEFiOPjPFDKMUzcfdbN82ZBojtl2ZGdAgrsnx4gBHCxsPolv2Pcecpso/9q1gfZ2suwe1AxT6NtMUbhG44P/DKycFZJbfMzbmsX8gaSw+uD2TDJn2G/qFZoH2QPqPwfNi1GkT/rm376KFfOZ8FX40a0Iq5fZCQljXaPbx4Zz5MXhr6ODAYH4Kd9vM/2b+xLyVHFsNcVSj8KsBAlBn1r1zmOYwqz2iT1M6CZPhht6dUjCnN+cbDZf0LWRmdwcQ== 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=MonK86NpvtlHHdQzY5B74Qko76adGrhdw0rMGGuXzrw=; b=ahMyBdVXqjI+L8LFKki5oqAH71aRlPSangNxpwq1NVLnF8LwawSJJm0PSrpGw+z6bXiUF2BfBrD+5xEbwn9RTcyXb7yFFrSTj/MAe0TU847ODQaoZ2rDCwqpN6jLdeZA+9Fxk4W5clzd7Usaaqd8qHnEmyV9PKUocDWuWVsho1f+lj2vWJjsaAkBSyprAFwA4QuYeUNQe+dJcENoV91e95grMEqJOUK7KJfwsMbLfUwfDUSTfrWoT2rRZScdBhna2AEGJO9HodLVTGrZJQdQ16MTG8wFjqK16lbp9B1g/iObgwdV8UeHZsuj7Vip9sqj+UN+aCOqlW/ju8iFNSrYnw== Received: from DM6NAM04FT064.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7ea3::50) by DM6NAM04HT262.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7ea3::441) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12; Sat, 6 Feb 2021 00:38:22 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7ea3::43) by DM6NAM04FT064.mail.protection.outlook.com (2a01:111:e400:7ea3::354) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Sat, 6 Feb 2021 00:38:22 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::b4c4:dc11:5337:821d]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::b4c4:dc11:5337:821d%4]) with mapi id 15.20.3805.028; Sat, 6 Feb 2021 00:38:22 +0000 To: PHP internals Thread-Topic: [VOTE] var_representation() : readable alternative to var_export() Thread-Index: AQHW/B9xf683ecv/IkqtfdUd2l2juA== Date: Sat, 6 Feb 2021 00:38:22 +0000 Message-ID: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:A0EF64984DCA43E12238CAD21C9E8437E75E974DCD7C32EA90B750859772C2C4;UpperCasedChecksum:8DAAAB15806E27EB1097B4BB81CBBCEDBED66A860545A4C932D54F54784A8972;SizeAsReceived:6832;Count:41 x-tmn: [7R3OY//e/PG3S264sVkETTnn8OJN4CXCLg+MBBhvlaArG31Ho2qTrrvFkqAOhBR2] x-ms-publictraffictype: Email x-incomingheadercount: 41 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: cef43c50-ca1b-4685-97f5-08d8ca3781bc x-ms-traffictypediagnostic: DM6NAM04HT262: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EQLM86DX7hkPsPQ2kQuHjteIWDQ9GtxJXe0OeaV/MafIOH0R066/2qZulPX9wdD8dwJuIm4Fk8i7gaQVJi8rbgWbJ84xNLwN8kRJEmbibKqPupmk3KGA7mN8M20GSiSrfEK+7tH91/EriSafK//SwN02pSLUWf0mv78t9Va5I/4lywrN0Y6IElg58bGYuU9HlFZ8KCK+cDeNSF4Fz8u1j3ykoNa1o9c5qeu7LvdD6unJ0PzkoXYLHh8ay2Zyr+OMrBVY766G5cvZJqgQKZj3tgGolAHeilW46bmXNm6nFqvGF1AlZps1yz4SXJ/vuQqgSbwcPIoWguhTzT1Oa/a4Bfl2OayoqgVNRNwLD+qoUByPcAfbLvqH00cUn9h04YnT/uNAJ0PBfRS9VV44O+V/LBy/Pcnhik4XFZ87hVn4bfBbfkqvA6rf+hSyCsgwbIS2 x-ms-exchange-antispam-messagedata: J9eo34oyHmaHNrE/boN910/GRJDLPeCwY7cWXFBQj4j9MniHFKJ1h/IdnOSh2Q0KlTNK1iifYUQK4UTMxJzvrdoIPxFu9tIv3OCrbEY4VFI+7vdU3rNjCS+VWU3PgDTvg2xLIIhVYOsi7tpRY5uoJltExRo9RJbuW+fAFUIhr5716o1lhPsmp/9WLDDtmRWrwebpgn3+OAo2PQiJVavMVg== 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: DM6NAM04FT064.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: cef43c50-ca1b-4685-97f5-08d8ca3781bc X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2021 00:38:22.1147 (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: DM6NAM04HT262 Subject: [VOTE] var_representation() : readable alternative to var_export() From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= Voting has started today on https://wiki.php.net/rfc/readable_var_represent= ation=0A= and closes on 2021-02-19.=0A= =0A= This RFC proposes introducing a new function `var_representation`=0A= with the following differences from var_export:=0A= =0A= 1. `var_representation()` unconditionally returns a string=0A= 2. Use `null` instead of `NULL` - the former is recommended by more coding= =0A= guidelines (https://www.php-fig.org/psr/psr-2/).=0A= 3. Change the way indentation is done for arrays/objects.=0A= See ext/standard/tests/general_functions/short_var_export1.phpt=0A= (e.g. always add 2 spaces, never 3 in objects, and put the array start o= n the=0A= same line as the key)=0A= 4. Render lists as `"[\n 'item1',\n]"` rather than `"array(\n 0 =3D> 'ite= m1',\n)"`=0A= =0A= Always render empty lists on a single line, render multiline by default = when there are 1 or more elements=0A= 5. Prepend `\` to class names so that generated code snippets can be used i= n=0A= namespaces without any issues.=0A= 6. Support `VAR_REPRESENTATION_SINGLE_LINE` in $flags.=0A= This will use a single-line representation for arrays/objects.=0A= 7. Escape control characters("\x00"-"\x1f" and "\x7f"(backspace)) inside of= double quoted strings=0A= instead of single quoted strings with unescaped control characters mixed= with ` . "\0" . `.=0A= =0A= Thanks,=0A= -Tyson=