Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110216 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28035 invoked from network); 20 May 2020 14:21:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 May 2020 14:21:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 611DD1804F2 for ; Wed, 20 May 2020 06:00:38 -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=-0.5 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (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 06:00:37 -0700 (PDT) Received: by mail-vk1-f177.google.com with SMTP id z3so714387vka.10 for ; Wed, 20 May 2020 06:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=qsdTfURHqOHuwzHhWQK4JLGHRxFsTp1t4gOsnv3Akdw=; b=wg3agjGztzmcuP8y2qWSi51gt7ZAa3QmOB9tf/oyaYn/FPc0vlyjbauCZe1R00UmPh dgqGmOVNxJoOzK0IB7BC+8vxI/mt4JlnL92WtEkBSBzufxQISCMwNr00+5hQjRSjEE9Z dWAsFKdP3hMlsY4ZSwl2OBk1AKStTrNur3c4KpKDNjJqXaXHz6EsAYpB5rA+TvpxqhUm UGrGpuq1kgmB8CXhVhc7RZzhxE1BGDxEcHVBT9U8DykMrHjLCGFc/dRpj3oNUjvPQFi+ bA024vRJ3Q78/d54JzVl40f2AexmCemc+QHClXurnI2KLxzs7tJ0svWopmH61dz8WhT1 wS0w== 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=qsdTfURHqOHuwzHhWQK4JLGHRxFsTp1t4gOsnv3Akdw=; b=SpBbhgmcHLG8/0jdg99Z/Y8MG9XJGQi+yoExrC6mU85dc8Ori/qYGVQ3c81cuUii2W O2SMWBY2sPhtBsyj2lGyhOGTHOdOts5w/PxQtxDlxnq3slN3UrXRuX0scaCmhpN5ktNV WGtcyXsbsi7GaXGoY7rOS7haRYJFB+PxMxEEMDX1ruxkW4TLMthWvj0gW6nyUDAQFQ7z b0MwaX0A9hZg1yzaAKQ+O6OZPRPJPctwaD4TR9h4kZmO+BfCUfA/6R/lQUnCrfpeZbFf fUdM+WgCR/gaH7C0ay5EbgzT2UDivkl6RzhksYDsginFnLkFOKD9wJIfpTAuRk786HIr sr6w== X-Gm-Message-State: AOAM533K0e4O8tUdbDI/wikdLJcWaU8xIYZS9WNXlTqngj0t+4yOGwNy oTAarqnPJkTclb+92ME+nBiZ7HBy+tePQyLMt7dmxuuXRnhqlw== X-Google-Smtp-Source: ABdhPJwZvsOvKQpZ6CGFxyqx3Zfh8lvzws9XB4ar6uOgvNiry7o3Pf6V6EkLgaWGda0XTmv3KoNJwGra0qFEJA0awds= X-Received: by 2002:a1f:8cc3:: with SMTP id o186mr3505547vkd.18.1589979636698; Wed, 20 May 2020 06:00:36 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 20 May 2020 14:00:25 +0100 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Draft RFC callable types + callable type/function autoloading From: Danack@basereality.com (Dan Ackroyd) Hi internals, A while ago, I spent some time thinking about callables, and how they are not very consistent, which makes people sad: https://wiki.php.net/rfc/consistent_callables The reason I didn't pursue that RFC is that although tidying up PHP core to be more consistent would be nice, it would be a large amount of work, that wouldn't dramatically improve the developer experience when programming in PHP. In fact it would mostly just break otherwise working code. What would be better would be an RFC to make callables be more useful, specifically by allowing you to define the parameter and return types for them. Making it possible to autoload those types would be required, and function autoloading is also a feature that has been desired for a while. So here are two draft RFCs: Callable types https://github.com/Danack/FunctionTypes/blob/master/1_callable_type_rfc.md Function + callable type autoloading https://github.com/Danack/FunctionTypes/blob/master/2_autoloading_part_2.md I'll leave them on github for the moment, as it is easier to do PRs and track issues there but I wanted to gather initial feedback before getting closer to the RFC cutoff date. I'll move them to the wiki and formally submit them for discussion when the implementation is closer to being done. cheers Dan Ack