Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110215 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98691 invoked from network); 20 May 2020 12:43:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 May 2020 12:43:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8045F1804CB for ; Wed, 20 May 2020 04:22:07 -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.3 required=5.0 tests=BAYES_20,BODY_8BITS, 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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.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 ; Wed, 20 May 2020 04:22:06 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id g79so793157ybf.0 for ; Wed, 20 May 2020 04:22:06 -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; bh=Zi5a1SXm2/QTyE9pDzlLfH72I0JNVIZe0f28//Jv5ZY=; b=EWjlCgnRd+uNiNaW4VjSAwJ8klQpPSSVIE5nmnWeCoG4mj8atghXmauPTxe7+mJxPQ na4VAwFro1u0Wb4Ysd1NS/pL04DvhU3wTv/XdhJIQ3vUIAzZ81GPak2DLuspDleQiOYr QySSdVXn2PIhsEDGmOnPh0q0CwPPGZJ7hLvmLbnwFdaX2EzavWTtUbNAhdTJQZoJKbB6 +uIZL1mSTtzBRHmxBUTmcXfmIhdvjFw+EcoaCo9AM0VBekcfUDgu8zRD1JQ+24RLEv8a u2yYspx57PWhIRhTZLtvVW98IodA0n6ny4dlAm2IuQruRtoCGixuDjwvvz3ap9g7s/C1 X9+Q== 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; bh=Zi5a1SXm2/QTyE9pDzlLfH72I0JNVIZe0f28//Jv5ZY=; b=XTrHG5s2LWx4WY2qOHuVLgKqAPobss7EHqp1r0TrjsqmuMXnEMo3ar2aSEk+LV80TN YdI4TDRWIsGm4wZBH+w1jDZHQWVkvPUVPdLeE52IE+klfplpAsGbEE2oijt6h3W1Savg RxzdP4bZHsexKMT0m4zAgYQnMNB8OMp0txKx9F9UPXX1l0XhvaJXG/Tt0XeKSRpdVqF+ +2FCOhT5VmRPb5jF2yfKBQNs+CERfgkpPlLHOGcvuqpExZChOKP373ppcRMw3MwD8aoq 3alkkkuQ6KQLIrZX/ojcXPfuLbdkxjmbAQ+wNcEmYKlY8V5kkkZrPpGPvYuznrLvvFpP iEFw== X-Gm-Message-State: AOAM531cjgtwV+YGCFHRwnfKVNyIt3zKTTNhPI2tlQX+C7FE5IYXP2Ub 3XQ1WicgcWAXuO6KBfx5a8zSEAIRHr5TqOdwcbk3QA== X-Google-Smtp-Source: ABdhPJyY4Q3btbCbUm1U6xU5xN/6gpZ5AfQgDsjX4835Ue/DQliQzmESEorIII8L92eeNvxE0t9ZIWbDTrngBae/XJo= X-Received: by 2002:a25:da52:: with SMTP id n79mr4913103ybf.368.1589973723551; Wed, 20 May 2020 04:22:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 20 May 2020 16:21:52 +0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000fe9bd505a6129afb" Subject: Fwd: PHP RFC about variables From: goootlib@gmail.com (=?UTF-8?B?0JPQu9C10LEg0JbRg9C60L7Qsg==?=) --000000000000fe9bd505a6129afb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ---------- Forwarded message --------- =D0=9E=D1=82: =D0=93=D0=BB=D0=B5=D0=B1 =D0=96=D1=83=D0=BA=D0=BE=D0=B2 Date: =D1=81=D1=80, 20 =D0=BC=D0=B0=D1=8F 2020 =D0=B3. =D0=B2 16:10 Subject: PHP RFC about variables To: If you look at Wikipedia, you can see that a variable in programming is a named, or otherwise addressed, area of memory whose address can be used to access data. The word from this definition to which I would like to draw your attention is data. Is it really so that in PHP and other programming languages in which we write, variables are used only for accessing data. In fact, in addition to access data, variables are also used to access objects, arrays and some other things. Data (strings, integers, floating-point numbers, boolean values), objects and structures (arrays) for a human are essentially different entities (abstractions), and it would be reasonable to handle them as different things, ignoring the fact that for the machine they are the same (named memory areas). In order to do this, I would like to propose (once again) to start to use entities such as, for example: object, structure, data instead of variables . This will help to greatly simplify the perception of the code, because you no longer have to keep in mind the data types of most variables. Code: // If formerly, for example, to store objects in PHP, // we used variables that are declared in the current syntax using the $ symbol $objectVar =3D new SomeClass(); // Now for the objects we will have a special entity =E2=80=9Cobject=E2=80= =9D, // which, for example, will be declared using the * symbol *objectEntity = =3D new SomeClass(); // "Structure" entities will be declared using ^ symbol ^simpleArray =3D ['one', 'two', 'three']; ^associativeArray =3D ['key' =3D> 'val', 'another_key' =3D> 'another_val']; // And "data" entities using symbol % %string =3D 'abcde'; %integer =3D 123; %floating =3D 1.23; %boolean =3D true; I want to make one point right away - my concept has nothing to do with the concept that is used in the PERL programming language, where each data type has a separate character. I urge only to enter one symbol for all scalar types, one symbol for objects and one for structures (arrays). The variables themselves and the symbol that is used to denote them ($) can be left for backward compatibility, as well as for types that are not covered by the new entities described by me, one of such types, for example, resource. The last time I proposed my idea for RFC, they refused me because allocating three new characters to implement it would be too wasteful. I do not deny that the remaining available characters should be used wisely. But in my opinion, in this case, the allocation of three new characters is quite justified by substantial benefits that this innovation brings. And due to the limited number of characters at the present time, it seems to me unreasonable to refuse futher progress. --000000000000fe9bd505a6129afb--