Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113288 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33215 invoked from network); 26 Feb 2021 13:18:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Feb 2021 13:18:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CBD1F1804E1 for ; Fri, 26 Feb 2021 05:07:15 -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=-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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) (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, 26 Feb 2021 05:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614344832; cv=none; d=zohomail.com; s=zohoarc; b=A5xuTTtR0E14qauGfa7dOz+OU+dJ5POFsLmCgpUrovejBN3DxOfQv/N7ZBYYRJXn6ca8pj9DjJQ7EyWVVso66FqnENFORuUXqk0hpxSHqVvkq99XinHyKDTq82KlzKhko7KdC0ZRtMrIywBDKJkf2ZiGTRsPu7+0WU7yOhuVIIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614344832; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=btElQVSO1lAtMV/he9m0Hhfok6TKCXQ3NhcoFB8yyzo=; b=ZEB8iDm/HbVckyY3g2qq2QSIHi9XNIzZd3wQtiwF7eHszVlv0hQCY/wMs1GsXm+J3RUOgHIGt/niouP+jqn+fdKINNYEqIZY0nynYDQn7lbqTwNSKL4Dc1WCmC/s4xxcLD94k12wLgV+zt0eL5go30Cr9adORt1EsefZcv4Os3w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=manuelcanga.dev; spf=pass smtp.mailfrom=php@manuelcanga.dev; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1614344832; s=zoho; d=manuelcanga.dev; i=php@manuelcanga.dev; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=btElQVSO1lAtMV/he9m0Hhfok6TKCXQ3NhcoFB8yyzo=; b=NkZiUjQKmHtJX7LAF2caji+N3PmA+DyYaoMrJds5fBBkXYvueP0VdmVcUNf48sDg QO60RTd7DiSnhY/RMze8R/3xmcctvHFGXYHOYWy4ZGQJNybNWm0hYI6mQ3lIN2LqM3I vbvrOgLRXhOW82fz3wwBDDafTfGM7m6GuT9f5ZRU= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1614344801533957.7002692781023; Fri, 26 Feb 2021 05:06:41 -0800 (PST) Date: Fri, 26 Feb 2021 14:06:41 +0100 To: =?UTF-8?Q?=22Micha=C5=82_Marcin_Brzuchalski=22?= Cc: "David Gebler" , "Internals" Message-ID: <177de72ccea.11911434f62085.9127926535122499607@manuelcanga.dev> In-Reply-To: References: <177db7bbf72.ecf4615f732310.8822018854991483226@manuelcanga.dev> <177dd68f109.c748581d17565.7200783349436492456@manuelcanga.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Subject: Re: [PHP-DEV] [RFC] class_name:namespace From: php@manuelcanga.dev (Manuel Canga) ---- En vie, 26 feb 2021 13:25:30 +0100 Micha=C5=82 Marcin Brzuchalski escribi=C3=B3 ----=20 > Personally, none of the above examples is convincing bc I'd implement th= em > using a fixed class names map to avoid loading untrusted classes. > Any kind of helper class is something I'd personally not use to avoid > static coupling of code and hacks while writing unit tests over > services that could be injected by IoC. > Full class names (whether they're aliased or used in use clause) have mo= re > benefit over class name string operations as they're easy for any renami= ng > which most of the IDE's these days can handle. > IMO introducing namespace magic constant has relatively narrow use and I= 'd > probably vote NO on this. >=20 > Cheers, > Micha=C5=82 Marcin Brzuchalski =20 I see...=20 I agree with you, however one thing is as we would like PHP will be used a= nd other is as it is used. - https://stackoverflow.com/questions/24798621/how-can-i-get-the-full-names= pace-of-a-class-without-creating-an-instance-of-it - https://stackoverflow.com/questions/13932289/get-php-class-namespace-dyna= mically - https://stackoverflow.com/questions/43630010/php-how-can-get-the-namespac= e-of-class-method-parameter - https://stackoverflow.com/questions/28182783/get-namespace-of-an-object-u= sing-an-abstract-class-or-trait/28182941 - ... It's like `eval`, it is dangerous, maybe it never should be used. However, = sometimes is useful.=20 do we avoid "dangerous" features ? or do we think people are professional(= I don't know if this is used in English equal Spanish ) and they know usin= g it when is needed ? I think that if something is common and normally useful, PHP should impleme= nt that. For example, `::namespace` or `get_namespace()`=20 Regards -- Manuel Canga Zend Certified PHP Engineer=20 Websites: https://manuelcanga.dev | https://trasweb.net Linkedin: https://es.linkedin.com/in/manuelcanga