Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112911 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43094 invoked from network); 16 Jan 2021 21:41:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jan 2021 21:41:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A8D11804F3 for ; Sat, 16 Jan 2021 13:20:41 -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.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_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2068.outbound.protection.outlook.com [40.92.20.68]) (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, 16 Jan 2021 13:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MLfekB01qGFD6JgswHYBrgqKw+jZXDilVjXxIVc+4Q5G+mYg48FX/oaQ8TlBSxKc0NDVzJKnL39lN5dON7xGWR+AvXphtN3ibtdTT9yahG+af/oJnVP6SureNLiIMa8eEeRA2nl28h3y1NusQIaRu4McssHxShgR7yzE3mYEkOAnpxmyokbhBWF8YHxsdh3eoXwBpWxfaMQ++ESeP5QvQ6KMNT+swoLLsGJaKLdwU1ErpjV0m9Wgzi/rFB2Gun97IRqu9qkG5bUShculNXwxSWiEANR2G2xwyDShyh/Tak4pXR5c3dxHg6S6vlgqWL+PGry1+YRV1dBgrwXfhywXYw== 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=JdUtUvndhkSX7zE5xbv/aTFvncDmCI5X636Q/kq6H+I=; b=aB7ZV/RYCf536iYlfzEShUUs9PQmMhXaZjpDbFlST84j8CO1KbMYoFV2WtI/ZuaPl8eJVCbCaevyc7Q7zEN0TgMGCTyat6500l5npd9QLmunRHPTmi7M8U7H6kEI461tdExiXg0s+jK0UR+C8IW3pfxZzb7g6j7Nj/4+gCiz8uw5lKANbmOMFTcgogVZNV4+cE6nEzQKLaYEUYmO13scJYAgU3MlCFY+nQ1Z18gxh+O2JVhEh/gRWejpM+IJy44X+PLGQQGhetWGjXBYqNC5Spm7qrwqMT/U2Wio1lTInb0zKeQd6x2+7IfS06zpVwpeQ4JCbhexnkR+yYpWv6xfFw== 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=JdUtUvndhkSX7zE5xbv/aTFvncDmCI5X636Q/kq6H+I=; b=mFdBZIxCxki7Sw+2rNCMS3KetjeXBGWHXlgHKexdzS6Np2V/feLBSJ7CQ0GOLFhliQwi4kEqG1OdyhvuJ7tTQKKBDvnFWK41IJoSTgcqwJVJ604N+gnlzp8hEmnTUsl+6MwgJSUDFpaInnYscNINabD06YFIBtvpnGGtAEuZ+mJ0FhLUmL3s1ITqzMF82bTi0wnd1ubgU/7wJQIuLYEqRS2gnTuU+W8dCZdSgdb5BT0P/z8ba48ahfBATvv8mt2vU6AMaXxAUthe7cuwvdwQb5kw5CXllh3BI5FL+FBAeGY7sQ6A/2a30z9PLa0G4ZV5bNYKrxIIekM3UV0QT73FoQ== Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::52) by BN8NAM11HT142.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::173) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Sat, 16 Jan 2021 21:20:39 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc4b::44) by BN8NAM11FT064.mail.protection.outlook.com (2a01:111:e400:fc4b::160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.12 via Frontend Transport; Sat, 16 Jan 2021 21:20:39 +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.3763.012; Sat, 16 Jan 2021 21:20:39 +0000 To: "internals@lists.php.net" Thread-Topic: [RFC] Configurable callback to dump results of expressions in `php -a` Thread-Index: AQHW1x7Yg3FUP/hma0qSEEKC7GDKEqoq6otI Date: Sat, 16 Jan 2021 21:20:39 +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:C83FE80560E64FD234B25DAE8080026B3C3F4CE3905CE7D9B29E922B68BF577E;UpperCasedChecksum:848180E71C1758EB9A4CA821930D5745663823AD783E6A5A6A4EEBF5E829F486;SizeAsReceived:7102;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [K+F391BkNSUe8ga6ijXQvJEXH9erN/isVTUizTpAvfA9J0LbcZmFKDuX2XfSzB6A] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: c7319667-f649-4cd6-54ff-08d8ba64929a x-ms-traffictypediagnostic: BN8NAM11HT142: x-ms-exchange-minimumurldomainage: github.com#4848 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TmkSPzcVhbV8686sqY26KRvr3f4F+6EqNp1aZE0iINg30HkGHStXgVckHbj2TTTljEvU3Xb/Trm05+mtr0nUlFE+cIcj1/RbDTdR8H5pXCe3OtsHOsHDZ1NEVWvB/CX3p9W/1jvTSOIPKlEn9n+AGoubFE7mLQPOpHK8fpTPTleDRdKLTwJ/vh58IUR/y0mkkvkCVLZWPyR9jdj5AOhW3sjPM9sORpH/HlTZi61zmVorktoS24F2bgBKDaamuKJ7jwN8N1BiUTB03A/FKT39fK2WGZPfyCeo0r/Wpe7WUew= x-ms-exchange-antispam-messagedata: LZRdqT+eWPfLZvx18DNMEsNuVqZJRgF2XQGfKHg9MnRqzKlSRgNL0J6V4ahGYOrQTEtBPPw6dU68klF4uaf9UmehfvovwysM/7vbK8jPveEFY+SIAEZegoaC8Xjej/EJaV0+4UFnS1jn/umAyH3v7JyirxJfdm/aDvKszzqOS5y3z2Hmj7S0RlBXzHubwl3KMcMMl0ht3vMYp6oHr8GrMQ== 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: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: c7319667-f649-4cd6-54ff-08d8ba64929a X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2021 21:20:39.1469 (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: BN8NAM11HT142 Subject: Re: [RFC] Configurable callback to dump results of expressions in `php -a` From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= > I've created a new RFC https://wiki.php.net/rfc/readline_interactive_shel= l_result_function=0A= > adding a way to configure a callback to be called to dump the value of si= ngle-expression statements from `php -a`=0A= > (and an ini setting that can be disabled to prevent that callback from be= ing called).=0A= > =0A= > Many REPLs (Read-Eval-Print Loops) for other programming languages that I= 'm familiar with=0A= > print a (possibly truncated) representation of the result of expressions,= but PHP doesn't.=0A= > It would be useful to allow users to extend the functionality of the defa= ult interactive php shell (php -a),=0A= > possibly with auto_prepend_file or through use of command wrappers/aliase= s, or after loading the shell.=0A= > Prior to this RFC, there was no way to extend the interactive php shell i= n this way.=0A= > (I've seen https://github.com/bobthecow/psysh mentioned as an alternative= for php -a while investigating this,=0A= > but that's a shell written from scratch, and doesn't have some functional= ity from php -a such as tolerance of fatal errors)=0A= =0A= I've updated https://wiki.php.net/rfc/readline_interactive_shell_result_fun= ction after feedback =0A= and plan to start voting in a few days.=0A= This RFC will make the interactive shell dump non-null expression results w= ith var_dump()/var_export() by default=0A= (https://externals.io/message/112568#112719 , https://wiki.php.net/rfc/read= line_interactive_shell_result_function_straw_poll)=0A= =0A= - The dumping of expression results can be disabled through a system ini se= tting or at runtime=0A= =0A= ```=0A= $ php -a=0A= Interactive shell=0A= =0A= php > 0.5*2;=0A= =3D> 1.0=0A= ```=0A= =0A= Thanks,=0A= - Tyson=