Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111967 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7809 invoked from network); 1 Oct 2020 11:50:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Oct 2020 11:50:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 311AC180511 for ; Thu, 1 Oct 2020 04:02:52 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 ; Thu, 1 Oct 2020 04:02:48 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id qp15so6476113ejb.3 for ; Thu, 01 Oct 2020 04:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=lHao5lnGLCLFe6yot23wAPc92iAo9vaG1NBr263l8T8=; b=t5SF+71bQF3x86mUfe3/jKriPCW9N0JzE1CUT8qCSwrP4yAqtoxhZ5GVLBDaKEeqMx LOi42atewT02zsq0soh0uhnk84mLcL8mAib66O+GEdz8sJqAhtwwOq83bsIxoAPCK2Zk t3tQFN48O/w6j6+7h8J7XbwV1tGzyoJ/3Gu5Ow4QAJD4O9w86YR2YEa5oXzjmBSoqahk mm1q6e1k2w6nJ4QpMVX2a8hY6V8l1vgxMYvUJrBTzDNeuj2J1FA4OKwS18ILEOvxXyrv VMS1Q4Tc023kbiyUE649VPQ1hfWdy2IhONvP/WAKG5QyEar9k+PnwewLrTQOl+cFfHEb AwjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=lHao5lnGLCLFe6yot23wAPc92iAo9vaG1NBr263l8T8=; b=HbgW8QD0+oIpBUNTgoN1aVSdkixA9quXZraHovoasYR5Tl/AxBr8zVHhVUUtCdMmXv sLwXN/IQGgGkqX19Ol1J0OD3vO2CED96aDtdqZA6nh6+GLCGrGj1AoQE6fWTG1Yua6/V PI8XbyDOeGS5f2zZES+rIFYIoHLB5LKZGXcE7yr1HxO10hAd7JRis51DCJeMsEPS7sQN wFQRyAnT+RmtaiLFcnPZUVs3jfGIYqsw2MNtR+b2YXSS4OsWQ1s7DsVT2r8e5y1QDJwk STqarbflZ+kg0F+JUx34CujeAjmbMTWWvYm0mAtj26Nv9XO29kX0R9Jm015cwrjui0sL HPtA== X-Gm-Message-State: AOAM531iTJTk6a4M88W4Fsg65dNuTRNFHxKSv3mPKBMEXLo7RLtaPme3 RvfzWHVP56WDq4djcVMuDHVko/IoYrY= X-Google-Smtp-Source: ABdhPJw6DGHQdjP3WdriHA9LkWWFkJ5D82QbIItSAByJI4UciC1LJ7qiHgDBo5jffJExWT4Gh63J+g== X-Received: by 2002:a17:906:8510:: with SMTP id i16mr7437935ejx.234.1601550166234; Thu, 01 Oct 2020 04:02:46 -0700 (PDT) Received: from [192.168.0.10] ([94.147.158.57]) by smtp.gmail.com with UTF8SMTPSA id g3sm2195538edy.12.2020.10.01.04.02.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 04:02:45 -0700 (PDT) To: =?UTF-8?Q?Micha=c5=82_Marcin_Brzuchalski?= , =?UTF-8?B?6IKWIOmRq+mRqw==?= Cc: "internals@lists.php.net" References: Message-ID: Date: Thu, 1 Oct 2020 13:02:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Thunderbird/82.0a1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [PHP-DEV] RFC: execution opcode file without php source code file From: henry.wood.dk@gmail.com (Henrik Skov) Hi list ! I would support such a feature as well. I am working on an implementation that would integrate PHAR support and opcode cache binary files (so that you could make a PHAR file that contains binary (opcode cache) files) I am voicing my opinion here because the current PHAR implementation does not work with binary (opcode cache) files. (The problem seems to be that the PHAR extension directly extracts/opens the phar file directory, compiles the file into opcodes and then executes them) - But compiling a file into opcodes that is already a binary (opcode cache) file yields garbage... So if this feature were to be implemented, the implementation would have to (in my opinion) solve this problem in the PHAR extension. The way I have worked around this problem is to implement some extract functions (require_once_bin(), require_bin(), include_bin() and include_once_bin() and then make sure that autoloaders used in inside the PHAR use those when reading from/including from that PHAR file that contains opcode binary files. /Henrik On 01-Oct-20 12:36, Michał Marcin Brzuchalski wrote: > Hi, > > czw., 1 paź 2020 o 11:36 肖 鑫鑫 napisał(a): > >> I commit a new request path, the request is about execution opcode file >> without php source code file >> this RFC provides similar to class file of java and pyo file of python. >> patch is: https://github.com/php/php-src/pull/6146 > > I had exact the same feature in my mind and working implementation few > years ago > when PHP 7.0 appeared on horizon which didn't get a Zend Guard support. > I like the idea a lot. > > One risk I see here is people putting whole framework or apps into one PHP > file before > calling `opcache_compile_file` to produce one big binary file. > > Would it be possible to move this feature to separate function and pass > iterable list of files? > I am not sure if with current OPCache file format it's possible but if that > might reduce amount > of steps required to produce one huge OPCache file which then can be loaded > by interpreter. > > Second thing worth of noting is that PR examples use CLI SAPI and lacks of > examples how > FPM can load it. Would it require at least an index.php with ` 'myapp.bin';` ? > > Cheers, > Michał Marcin Brzuchalski >