Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106840 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6205 invoked from network); 4 Sep 2019 06:18:17 -0000 Received: from unknown (HELO mail-io1-f66.google.com) (209.85.166.66) by pb1.pair.com with SMTP; 4 Sep 2019 06:18:17 -0000 Received: by mail-io1-f66.google.com with SMTP id r4so25857250iop.4 for ; Tue, 03 Sep 2019 20:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=cE2IBDeml0B+bfYQWx0GdOUhb3ouPBMh7XdGETlmeRo=; b=KA80N++OCJGBsCDL5ShWBea7yS758uT4F3KbSyltMm8ok8fFw/+JWeRPcxGKWBVyFf 1B1llqtvuEcnCq/sLgjrolfUFyOEqEuYCuxTEHfFUPDun3w/XiqjogPkfYM0yBbuf/QC rPzzQxoR6zKUfcW4m9cUxhi4/LxVbnwuxlngZBC3P1AF1N59B+UvVLAPiKfR6dNeZCTj G592BA3jHTWbKrRWZnXYYIlWMLNrP+CxDk5oxeYAImTWJ9mqJRPSdBgAeiLCU1yJ7iSt DkDQDC2Kd8ekoMwYhfSUIWXP7/yTYNAYDYHqZjFWYxouVuEAv/pcfRpNxocz6y0XjCGu uBlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=cE2IBDeml0B+bfYQWx0GdOUhb3ouPBMh7XdGETlmeRo=; b=dp5OmXEhjcYz/ClnptEPwRvwpG5bYmieRG9UaMHy/l8mkHJnsvkHx8MUMW9BZu9Bmv EP7DUz4Oe4gk0OUYJa9NnShx9ljd0DiS/BpwEXYr0l08LdBAMstaboqy9bYozfzRV5pX g22RROs5lfjqAJyAjz7et72+ypmpiIGunxueMoRxruh0PJLiCfuBrb3V/rzmkWtlzWHk doda0XdeMv6/jEYIrXhq8BpqucUNpZRjCMO7ohQ/pE8SubGdRheHyQETOmkmiC+vRakB sAeac2WmzEPiwn/E+0C+vsF62RPPQRtbYlvGq9c3era0Kk3ZrzdgVxfdMTOZopNsCuYK FVOw== X-Gm-Message-State: APjAAAVi+AQDITaxzVbNhxeSH1HKjNqK8V7kiGJpDU0OT8F+4KN24Y96 iLdA2Z1Q68oYIuz+7u7d+jIHGFYWTElWgoUdiLcqpw== X-Google-Smtp-Source: APXvYqwWcJ0+fLprOnSl8L1unh3Q7SO2mLWntRchcRQrDQpwZseLcV023a5K1ZkfjIYI37d27xxtqtr5SFZnR1DCKXs= X-Received: by 2002:a5d:9282:: with SMTP id s2mr26159344iom.283.1567569125018; Tue, 03 Sep 2019 20:52:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a92:510:0:0:0:0:0 with HTTP; Tue, 3 Sep 2019 20:52:03 -0700 (PDT) Date: Tue, 3 Sep 2019 20:52:03 -0700 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Silent Types From: fwentish@gmail.com (Fwentish Aelondes) Hello internals, Zeev's idea to bring peace to the galaxy seems like a good idea, but impossible to implement in practice. But it got me thinking about how one might introduce static typing into a dynamically typed language w/out breaking BC. And then I had this crazy idea: //int $i = 0; //string $c = 'c'; //float $pi = 3.14; If static typing in php was *only* an opt-in kind-of-thing, would this work? Could the parser be built to identify 3 or 4 different keywords in comments and give warnings or fatal errors for type conversions of variables that have the type specified in the immediately preceding comment? Just a (crazy) idea. ---- Fwentish