Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111408 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78022 invoked from network); 9 Aug 2020 23:12:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Aug 2020 23:12:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C5E931804D9 for ; Sun, 9 Aug 2020 15:11:24 -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_H4,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 ; Sun, 9 Aug 2020 15:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597011081; cv=none; d=zohomail.com; s=zohoarc; b=M0kPd/Ed/9zz0brHddcojeDEi0BpuMSWaRVF4wBfmSAtTAkCLtsiLaHCpstwGVgKjzamaZrSsF7eIYGlv2zUmjx25nuI7/7hB8b3Ctx9J1ET0zfY1N8QhsgKz8kthtjNKltQZ3IdsBryjUWM6Mvtbl/Awe0hIcsEohpJjB2MBtE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597011081; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=iuoe1vR5H2RC2J3cJRPhDevObz6GTQHSWnUshSk8DCY=; b=K1L1szn5hgAB/uhLe7DB7Vgp9cP4VhCN2QA/MFhhmIk7wC84pDYo9U8HPEpjvCJ/si13gOdTx0dtfasbfhiWaPQwBDTE1FvwNRqB+8OBPXdz2zF60tH5xQ3IMKux2uHvo734HM0D+i46Cu51WSYMxQE1eHyt+DLjvnigODY2CzM= 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=1597011081; 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=iuoe1vR5H2RC2J3cJRPhDevObz6GTQHSWnUshSk8DCY=; b=DRpSh5w9FvY344JMRuRml0Za8aKyyTryPp2GsZL0WrSkyaAidWnmDHodKkj3zAOg lQD2iXUmdtvGEiHL4n39ZnB8kz+wVMX5aKstX4dos2yt/F3g0/CZ44+0VWa/sO04dC6 ayer1DaKMFn6qP3dtHNnz2NO0QEyMH5v3+bAi/3I= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1597011049795288.8062859480349; Sun, 9 Aug 2020 15:10:49 -0700 (PDT) Date: Mon, 10 Aug 2020 00:10:49 +0200 To: "Josh Bruce" Cc: "David Rodrigues" , "tyson andre" , "Internals" Message-ID: <173d546177c.11cd2a197581064.2573913122997708842@manuelcanga.dev> In-Reply-To: References: <173d2736435.eeebc066559719.6668730031195302987@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] Import of variables From: php@manuelcanga.dev (Manuel Canga) Hi, Josh. Thanks ---- En dom, 09 ago 2020 21:36:30 +0200 Josh Bruce es= cribi=C3=B3 ---- > Have not tested - just catching up on emails. >=20 > To verify: A property defined with a default value of the global does no= t already do this? In functions/methods. In some files can "inherit" gobal vars directly or si= mply "inherit" local vars of other function. =20 > Developer need: I rarely access global variables directly - usually goin= g through a lib or framework. When I do I would probably wrap the access in= a trait or method on a class. Some frameworks or CMS use view files in PHP like templates.=20 https://platesphp.com/v3/templates/syntax/#syntax-example In WordPress case:=20 "Developers are advised to consider this a Reserved Name List, and not to c= reate local variables with the same names in Plugins or Themes. Under some = circumstances, the global variable value will be replaced by the local vari= able value, causing errors in the WordPress Core that are difficult to diag= nose. " https://codex.wordpress.org/Global_Variables This could be avoid easily with "use vars none" on the start of each file o= f theme/plugin. Regards