Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115383 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51713 invoked from network); 10 Jul 2021 10:42:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jul 2021 10:42:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C0C61804D0 for ; Sat, 10 Jul 2021 04:05:15 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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 mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 10 Jul 2021 04:05:14 -0700 (PDT) Received: by mail-oi1-f181.google.com with SMTP id j65so9850006oih.5 for ; Sat, 10 Jul 2021 04:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aONwu1HOajcofEioTgOFXPVmu+nq/AURyie6gXCpJfE=; b=WRl1DfsDIzRP0k9dgCM/2ZSSA7BjiHihKBAht1IucHunUSVdDDNb6m3QALUm5ro9U9 PFawfdiWe+TFap5H6k49sPNv36EKDCJznmRQ/dBueoMx6WIfRVUhZMMuDDuCQ72x5oOq PzWFPnRqvjQdVoVIIhwVfohdUm9glXitiXPeQS0Yh0B2C1PCjf/fJ/lwL4byuvsQdeVF jTKHT0JGmrEqr36Mg1eHyPPWDQfb/49IAZqNQ3CPC6ELemnm9W6jJUraSsZALpqat6nP wTN+pDga3ybh0FRRUvnqJKvg2TbmzVQTG4Mjslx5XyhCGZ9Uk1fEY+wIWiaojEjZmtE5 68lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aONwu1HOajcofEioTgOFXPVmu+nq/AURyie6gXCpJfE=; b=eFMt+7TMht4jWVo8/jHlc235xUy5mbdlpurg7RuHXfADIm4tehpibbcNJT5FYGdR44 9lfwlnIXb+ClM/nDsTlPlNe9ErZk3ensfocVsDxFCfvCyk1zuz8HHO4wZ0wFbwOmlE9u imjCL4HksH0cJn0FfEAgBxSZRpEVNxkSdU6ArM9mjlEIkF0VWQWWHAsbCeHzbIK9/Rqb lVDLgK0v5oXnvBdiOkJ645sZHBh4kzdeuXf+uPkDXueYHErUrnG2zySqldGWF5VGL9/V GJOy1HlSw/UtAOvVkRfm8bv0YFPh1acJkjIN8hrXkE7Ua4XhLCvDNT1haXjov1jdc1CU RX0w== X-Gm-Message-State: AOAM532FSvHh5Ny3BmIst95IF47LB0d+Ww1sRUHDFD2IxX9QDgT5TGq9 HuHM1uEO9XfY4EzsAYSsYA25Xnfz5Do/N4i1tFo= X-Google-Smtp-Source: ABdhPJzWx1QH0EbL1onmL0e57DWIX2PYgq5bMIULFth6svyWEZatb/uQGoEWYJj137mXsixYkvBT8Kf+mrKQj+DbyUI= X-Received: by 2002:a05:6808:13d3:: with SMTP id d19mr2921022oiw.134.1625915114083; Sat, 10 Jul 2021 04:05:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 10 Jul 2021 13:05:02 +0200 Message-ID: To: Max Semenik Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000cf597305c6c2dcb1" Subject: Re: [PHP-DEV] Type casting syntax From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000cf597305c6c2dcb1 Content-Type: text/plain; charset="UTF-8" > I've been thinking about extending PHP's cast syntax to user-defined types, > e.g. not only (int)$foo but also (MyClass)$foo. Currently, a T_STRING in > parentheses is always treated as a constant - would it be acceptable to > hijack this syntax when used in unary operation context, i.e. "(" T_STRING > ")" expr? If not, any other alternatives? Hi, I proposed something similar a while back, you might want to have a look at this discussion: https://externals.io/message/105332#105367 - Benjamin --000000000000cf597305c6c2dcb1--