Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115417 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48412 invoked from network); 12 Jul 2021 20:13:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jul 2021 20:13:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4AAA3180089 for ; Mon, 12 Jul 2021 13:37:02 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 ; Mon, 12 Jul 2021 13:37:01 -0700 (PDT) Received: by mail-qk1-f169.google.com with SMTP id q190so19366983qkd.2 for ; Mon, 12 Jul 2021 13:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=50zeDFLanmp6S16wbRDjpH2mJnfRbHO4EHLQHwG2/2k=; b=vwlAD8hnN3cCaXKoGqCdbmlJrSiHzqDWJF2xBLfGrav3QfLaSr7T/W2JNvZP2nxzd+ p7HTV0udzeWZ7otjtVJnl9VcTfj1Z9sWc6CJL5tMDlPrdkL3VTbe2yJfLaOhZdPyHH+k tGYu2hf3MiyoI5Dk5JHZveN0AIyWpV6Pq7A8pS68nZo9w9k1nxjbWO+sE3YimupRl2GD kO+HnO9cqbEifeDJ9XHHIvZrtr1XnOR5SIq0VJCyZRLIVQMp8NXgPC6zBtcoKTa6b797 o3QfFnDmzfCFiAc4YWxGRXjbzOwTupcaUb6dIB4lxhPwNkftOqtcTYWohJ1LiG1t7/ak c2eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=50zeDFLanmp6S16wbRDjpH2mJnfRbHO4EHLQHwG2/2k=; b=K8OeLNNIzRHAgQqIkZPqyXz5U2s7sUzMyAhLcyHUJOU+Qhoh4Q8go2QzQZOrC1qBng Bi9hneqv63up16NWk84EvUAxIE7ASxNRITxlGHqlarWEuKY/T4tX0LecBg+1Q4Mc+Lt5 GnHqCRKdp+tYMnBPQ0fReJdPUVAL37aZxxixiieIg7XGn2uhs3XMYR78ptzURxcHgEHV dEfunLU/HjwWommmVqRaKwPTofFxuZRttxPaaRPNr5ZZ9D2BTIvuszw3i0Jk6jGBQdxf Pa6ETAYgOy/qDo2JPf3d8UgI9FgethA1bv2SS4LxS2Vus+x8OUcwZ061uZ0XhVBqATjH jSpQ== X-Gm-Message-State: AOAM530bg9BnodVmWj/626FeaWjGJR8zbseJv7n2qC6WAUss9i+3FZJb 4pA+3E9vSlDX95y4bhmTvnLfdQ== X-Google-Smtp-Source: ABdhPJw3z9aWwZeYIJe/R7FDA6APCgNro1Ky1v3Y4SQTMeMrYJG5R3ETwsdfy9am2zCXNaQ48JW6Qg== X-Received: by 2002:a37:7704:: with SMTP id s4mr538118qkc.447.1626122217185; Mon, 12 Jul 2021 13:36:57 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id s202sm2543607qke.80.2021.07.12.13.36.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jul 2021 13:36:55 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_856A1D33-DE54-40DC-8DA2-269CA78635BD" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Mon, 12 Jul 2021 16:36:53 -0400 In-Reply-To: Cc: Max Semenik , php internals To: Lynn References: <0d28ee72-accd-4dfc-a8e0-018c99e4a86d@www.fastmail.com> <90547b22-1b12-4cdb-acf5-bde6cace8aad@www.fastmail.com> <351E0836-93B1-4021-9754-2681C6E7BA34@newclarity.net> X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] Type casting syntax From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_856A1D33-DE54-40DC-8DA2-269CA78635BD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 12, 2021, at 4:28 PM, Lynn wrote: > On Mon, Jul 12, 2021 at 10:20 PM Mike Schinkel > wrote: > It seems you have just illustrated why in reality we really do not = need type casting/assertions in PHP given its current features, because = we already have what we need. >=20 > That's not an argument I agree with, as it would invalidate the need = for short closures, null coalesce, constructor property promotion, etc.=20= >=20 > Continuing on the previous example: > ```php > $service =3D $container->get(SomeService::class); > assert($service instanceof SomeService); >=20 > // could be replaced with > $container->get(); In your hypothetical view here, what happens when the $container does = not have SomeService to provide? Does it throw an Exception? -Mike= --Apple-Mail=_856A1D33-DE54-40DC-8DA2-269CA78635BD--