Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114203 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93693 invoked from network); 27 Apr 2021 16:22:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Apr 2021 16:22:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 60BD31804BD for ; Tue, 27 Apr 2021 09:26:55 -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,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-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 ; Tue, 27 Apr 2021 09:26:54 -0700 (PDT) Received: by mail-io1-f45.google.com with SMTP id k25so17156113iob.6 for ; Tue, 27 Apr 2021 09:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=r1Rl/B/q03sl7UsQ0EyR/C/xxnsRfxZ59suvCV+hyyE=; b=gyBnI5KE8aBRSUGLgM19fZCLEy8uJ5fEh+VxF3warIK5h2y4YLZrBKWAY/0yhlYME8 pUXuQNaFV2n/cQFcCcR53SkwljC5PFkqtSbJHtZ+rVfIJ7ssmLV5CvIN6sXHtK87ZnvZ XwLDvhCvyCNf7zN9x5aEbS+Ia/jNfRjkbzUOB7Z4OayLznzojCxyIbJJAEc8a5wWmBal PlfViK5hB+CS/N5wgD+lgS9s9L68CBX6BA93+94bp8hzN8rZ7v/i+5frB03Vv/TBtUkW Sof9cF2+NsoLOsxF8Oi+GRmI4ojCk3rnjvkAZIE+u4Hik2BKQ18bSe6U0sxKnPAOcv3o 2klg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=r1Rl/B/q03sl7UsQ0EyR/C/xxnsRfxZ59suvCV+hyyE=; b=uOfd6i/pjEl+ye3itc3gCF71KIYrQuWZ9EQdEr3MNMOpsc0FXN81T3lJb8TlT6MmZn cRry+c+pHBdlUQI/FopJBPIwMsq9oR9LCBW3mW7Oi0K88UkS1JjgFVFHXBUoMCWZMsKF shh/4UsB+tbTZhAfZrKylTcouzbkYHQUmbCuaKCZZ+GaoLAkrjpMqEdC3FBH66qTfcqb Uu8ibMc2/alCwfwMT3ghHQoc2D0TyeRz0K9acpzrp1EVbtaquLo4ANDQ7s//4WYvUdzu UJ1hRZzb+G6AOJRZqoy0c+np+Zqf9yNUsvRfdTUr2jKTlv4UGnj9O0WbvNYaCILgxx6p 9/RQ== X-Gm-Message-State: AOAM530uvdkrbjUrv6/bqs/+WtjIIBYrKQOZzEeyK7pRIuRIHkR2tYKX k+vJZMsMTpjZfiRMF9yvQp2st1ChTktnAQ== X-Google-Smtp-Source: ABdhPJzD3BERZ0wfhUjnh937G+U73OyhDBgSMVZh9pJsgOcOE8p0D/jF81ATyea0NTTOccpebzR+Xw== X-Received: by 2002:a05:6602:714:: with SMTP id f20mr20928297iox.178.1619540811041; Tue, 27 Apr 2021 09:26:51 -0700 (PDT) Received: from [10.10.42.56] (h96-61-105-82.lvrgtn.broadband.dynamic.tds.net. [96.61.105.82]) by smtp.gmail.com with ESMTPSA id h17sm151234iog.47.2021.04.27.09.26.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Apr 2021 09:26:50 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_B9A40238-9AA7-4B27-9218-52E6CAE0D13B"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Tue, 27 Apr 2021 11:26:49 -0500 References: To: PHP Internals In-Reply-To: Message-ID: X-Mailer: Apple Mail (2.3654.60.0.2.21) Subject: Re: [PHP-DEV] Method overload support From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_B9A40238-9AA7-4B27-9218-52E6CAE0D13B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 25, 2021, at 15:12, David Rodrigues = wrote: >=20 > 3. Poorly typed functions or methods cannot be overloaded. >=20 > function printId(User $user) { ... } > function printId($user) { ... } // Fatal error Since the second is the same as `mixed $user`, why couldn=E2=80=99t the = engine pick the most specific method for the signature? If a `User` instance is passed, then pick the first method. Otherwise, pick the second. Cheers, Ben --Apple-Mail=_B9A40238-9AA7-4B27-9218-52E6CAE0D13B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCYIg7SQAKCRCwLZeYnIwH G03aAQCJ0XE4E/w3bKGwq/iueb1QhifG1vbnPvYdx++oszv/ewD/QszhR2sMQs01 XCEN0AofwqzjkaJqtMDG1AAS0egQKL8= =EWBC -----END PGP SIGNATURE----- --Apple-Mail=_B9A40238-9AA7-4B27-9218-52E6CAE0D13B--