Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123318 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id B108A1A009C for ; Tue, 14 May 2024 16:24:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1715703931; bh=z42leejscfj4edcPPzwgibgFdlUcPFIF9Bl9xQFi0y4=; h=Subject:To:References:From:Date:In-Reply-To:From; b=OHIoZX/buWoPcgw4SOrngwTUGIizzeiQamsRvzSmXyAutveCe/URwEXgOQKmtabK9 m4D5c7Urt01odGzx+lUIqKKvelHiqAjRdU5SgoUMatFb4rzSCE/gNl0VVhYaZ0yAp4 V7U7t/X3h4GvXBkgNKbfgtHRVQYRkeYLE3hL4AzOrTD+jIsS0XpGLiKsghzd8chV18 EKgq8De0u+tL8z0uTNG8vRLoe9lYx3lYerJ74HUHyx+giAv0xUiotPHYfrDUbe7Mrw xgAgvfz1BiSRfeiZdNJAAIKWcmpIgsLxTzJ2txG0XO+V1/rCB4tiuf5kxIxsf4pFYG l8IlItno49WXg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0644418002F for ; Tue, 14 May 2024 16:25:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from rusty.tulip.relay.mailchannels.net (rusty.tulip.relay.mailchannels.net [23.83.218.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 14 May 2024 16:25:29 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 616F9902540 for ; Tue, 14 May 2024 16:24:36 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id DB548901ED1 for ; Tue, 14 May 2024 16:24:33 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1715703874; a=rsa-sha256; cv=none; b=Xbhl5wWVHdCNKRLChnhudxgqF4+Ulx+Nf5M8rrqCQEPvCRfyG/sl54TeEx78lJvfldFrz9 D1XGhDpIg2IWdbaVz2g8NWWn3BIPXmZnggCisbPIdE5lWAxPERn6OetPWVDfu2Os3Zjic6 iwj2JuecYx5t6B5rNgOMLQDtZVaDi9gV8x2lnpzF5QPZ5KG0vzmzyottFhxfya1vrx15hF UvIJrxUpQsDtO5b40yduIEWyVeH7XL6ky5fVaTlrtiU+mENPzrkAhuHvwd/F0CwMNybV+n b9EXMv5macr5veHK39E8sEd+YXyW2LGbfCLNdkxKQdGpqKWv55kJLG6l4s2r6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1715703874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Vfj4m01JX1oyrl1rBm6fBl+BTPxbcVVfw3TM1SNAN/A=; b=e60q3io1oBqtlHBkuz0EBqvc8X+K+nDLC3QgJ/qRLRdSRLw+kjLJiSaHLSW471YRKlFe8n 7yyQlm8qj0LgiV9UuafVBx2stt9I+N+yKQX5zM4QEz0QN+sRdMhHSfgasu2L/yDpg1g9P4 lXVLOJXVRgvi0esrBNjFyxovD2hCY3FVjZtDsb6mjjdewllekCWxWTtd60d9KpzyDWcakF frymy8fSpxzu4Oeb1liESMyHe426Mw1rc7iqPC/OW29EgYDZKlEmdjoGurV3VBVKbzKXBQ ayYPOkpfZRii82DNvxN3IPkUSsCWt/f1yIblRfzrrT6z9WuftZA+dzhd480zcQ== ARC-Authentication-Results: i=1; rspamd-5d55749bb4-kf8kb; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Bottle-Skirt: 04276ca376d42fdf_1715703874680_326281777 X-MC-Loop-Signature: 1715703874680:1314466873 X-MC-Ingress-Time: 1715703874679 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.111.87.7 (trex/6.9.2); Tue, 14 May 2024 16:24:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vfj4m01JX1oyrl1rBm6fBl+BTPxbcVVfw3TM1SNAN/A=; b=ZbNYVbJRiJdGV2vfrJXUAfGpC6 gQp2YNTVpAZX6PlvioxQzyUXiUqUCkCc4mBEP5UZjlYwjR2mYSjB82YohDuoPF9hN1tUf7zUOyPcM tdPwoLl7jIKKR9fapSHqu8VPncGYnCy2HTwHDLmL8guLrlJvO4wpXt2jUmzdd+D/CSBA=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.97.1) (envelope-from ) id 1s6ux6-0000000AAnC-0Apm for internals@lists.php.net; Tue, 14 May 2024 18:24:32 +0200 X-ImunifyEmail-Filter-Info: UkNWRF9WSUFfU01UUF9BVVRIIFJDVkRfVExTX0FMTCBWRVJJ TE9DS19 DQiBSQ1ZEX0NPVU5UX09ORSBCQVlFU19IQU0gQVJDX05BIE1JTUVfVU 5LTk9XTiBNSURfUkhTX01BVENIX0ZST00gSUVfVkxfUEJMX0FDQ09VT lRfMDUgTUlNRV9UUkFDRSBGUk9NX0hBU19ETiBUT19ETl9OT05FIFJD UFRfQ09VTlRfT05FIElFX1ZMX1BCTF9BQ0NPVU5UXzAxIFRPX01BVEN IX0VOVlJDUFRfQUxMIEZST01fRVFfRU5WRlJPTSBBU04= X-ImunifyEmail-Filter-Action: no action X-ImunifyEmail-Filter-Score: 2.62 X-ImunifyEmail-Filter-Version: 3.5.13/202404301715 Received: from [143.178.147.245] (port=53720 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1s6ux5-0000000AAn0-3sLD for internals@lists.php.net; Tue, 14 May 2024 18:24:31 +0200 Subject: Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function To: internals@lists.php.net References: <0a30b095-149d-cb45-3f54-3d904774c139@php.net> Message-ID: <66439034.8030905@adviesenzo.nl> Date: Tue, 14 May 2024 18:24:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------030307050700030207000900" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------030307050700030207000900 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 11-5-2024 16:43, Gina P. Banyard wrote: > > On Thursday, 9 May 2024 at 15:17, Jorg Sowa wrote: >> > I don't think there are any other "functions" like this. >> >> What about list(), isset(), print(), echo(), require(), include(), >> unset(), empty()? We use them the same way as functions, but those >> are not real functions. >> > > list() (and array()) may look like functions but do not behave like > one as they affect the current scope by setting various variables. > > isset()/empty()/unset() require to work with undefined variables and > have deeply ingrained behaviour within the engine, so making them > simple functions is not as much of a "trivial" change. > > print, echo, include(_once) and require(_once) do not mandate their > "argument" to be passed within parenthethis, so making them functions > does not simplify the lexer/parser nor removes them as keywords. > Also I don't know the last time I've used those language constructs > "like a function". > Seeing this list, makes me wonder: what about eval() ? --------------030307050700030207000900 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On 11-5-2024 16:43, Gina P. Banyard wrote:

On Thursday, 9 May 2024 at 15:17, Jorg Sowa <jorg.sowa@gmail.com> wrote:
> I don't think there are any other "functions" like this.

What about list(), isset(), print(), echo(), require(), include(), unset(), empty()? We use them the same way as functions, but those are not real functions.


list() (and array()) may look like functions but do not behave like one as they affect the current scope by setting various variables.

isset()/empty()/unset() require to work with undefined variables and have deeply ingrained behaviour within the engine, so making them simple functions is not as much of a "trivial" change.

print, echo, include(_once) and require(_once) do not mandate their "argument" to be passed within parenthethis, so making them functions does not simplify the lexer/parser nor removes them as keywords.
Also I don't know the last time I've used those language constructs "like a function".


Seeing this list, makes me wonder: what about eval() ?
--------------030307050700030207000900--