Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103402 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17384 invoked from network); 27 Oct 2018 00:54:09 -0000 Received: from unknown (HELO mail-ot1-f68.google.com) (209.85.210.68) by pb1.pair.com with SMTP; 27 Oct 2018 00:54:09 -0000 Received: by mail-ot1-f68.google.com with SMTP id 14so2371047oth.2 for ; Fri, 26 Oct 2018 14:09:52 -0700 (PDT) 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:cc; bh=rvlwWCcARy1XoVsMMH535qsBnRoDp5FiKoxLhwCnNW4=; b=ciQtaU+wHr7/s3KQaZKzU8s8FnRmpBGAq5OIpzuDALmoVsBtoekWw4UGwwr464AVlw T0qhC+FvzMTvtTb/RlUBxoSwR7LOljMvmeE0T8mBc0SblI3VC1OfoSSOGeownTbV3o2D JaPg58UeFkE1gV1QauPprrcuCWThDfENzFXy2DFjbQGk3wIfmD1VITQQvIQaurqyaKx4 yMovUypDrYHNdHULbwiRhI91h6jo3WZXh1WqXQwCxcYDz/FgV/z0Pbv+zFkrppKmKdZS Cdk9DsVLbsMK27IYmB7TFDRlKeQI+NlI/TXgipSqU+SwJvgZvasaMgnitd52iLygrMVu 3DRg== X-Gm-Message-State: AGRZ1gIovGsrffsfEL96UaMvb7PWBf1F2LlkdonEaN/KZ1eXiOx/v2o+ i9vRSxuh+MARJMEEY1c/puwi6qVZa/Tpgdi5rRiDRg== X-Google-Smtp-Source: AJdET5es1IZtc9HcmEBUZNMVlZZxn2HqhUhmlJGXBBLF3uV7eAZBTbkLAQqkz3BRRYvRmkVL973FAzcg3FCWvSWBPrU= X-Received: by 2002:a9d:7a48:: with SMTP id z8mr3461687otm.257.1540588191990; Fri, 26 Oct 2018 14:09:51 -0700 (PDT) MIME-Version: 1.0 References: <2370262.6EcsR2toYx@vulcan> In-Reply-To: Date: Fri, 26 Oct 2018 23:09:41 +0200 Message-ID: To: Levi Morrison Cc: Larry Garfield , Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Idea for better function callbacks (another syntactic sugar) From: kalle@php.net (Kalle Sommer Nielsen) Den fre. 26. okt. 2018 kl. 18.03 skrev Levi Morrison : > In my opinion "ideal" here is that our symbol tables are merged, so > referring to "trim" in any context will resolve to at most one symbol, > *and* that we also have a short-closure syntax for times when there > isn't a *perfect* function to use. > > In the next version of PHP I would really like to see some warnings > for when symbol names get re-used so that in the future we can merge > them with less of a BC break. I like that idea a lot tbh, but I do worry a lot about the lookup time if we end up with a gigantic hashtable to hold all the symbols and the implications it has. In most contexts we know (based on the syntax) what we are looking for, however as it currently stands then it would not be clear wether to look for the constant "trim" or the procedural function "trim" in the example given, and if thats all the same, I can see that many things not utilizing this could be slower for no good reason (at least in my honest opinion). However I don't know if there is something sneaky we can do here. -- regards, Kalle Sommer Nielsen kalle@php.net