Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107875 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1658 invoked from network); 28 Nov 2019 01:38:23 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 28 Nov 2019 01:38:23 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 82FB12D2028 for ; Wed, 27 Nov 2019 15:33:24 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Wed, 27 Nov 2019 15:33:20 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id r27so6082682otc.8 for ; Wed, 27 Nov 2019 15:33:20 -0800 (PST) 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=21tqSyE/mXd2AUKAVB6ok7SBc1ciFRCKEkfYHo4g0VE=; b=u+6rfne4KnuHeU8s5kDdq03/VZ4d5FajjOZVO3h7VyEw0CELGkW29JhLNTu2meUw3O WzjC84U/CZa36y5pRzica6l3kSFZ3WanM6nmAqmcfOZVdSdBdUKwg7vPjgGpUUK1hVBT y+8OJEWE9iNh5cSYPLaaWeP6N188l/jVd/Y5pGT/+/qSCbdfPkJw3RHprEL7NH0mDNl+ H6aLWCSDONNYOzT+EbpjPXBv3nvBWgP8Y5ydLtlYe5IKxY26g1UK9XbWSw5kLx76na5r egrEPa/NqtyN1txr3Z88fmn+LGqiSGwQ7vI+5OBUaq5iPwXNUvKaFOlXBg4l8e2nmPm+ TYJw== 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=21tqSyE/mXd2AUKAVB6ok7SBc1ciFRCKEkfYHo4g0VE=; b=Wm0D8jHNDE7b+gSpbCDnO3dAfwELGC8HRr4Mgb/KAhmNe6m7wOnIpzp3XHf06zvqHR m0HmakWBPl+EKx4uHiagGtxwGcnEZERplM+eRQDqqQ8uDbDfSn8S9iRILvKbttNWrvq1 TshQjD9E8W9YDrjrnshrW5zMHstgqlFWSNzI+S23MVRwrVhDvBbW733lYVbMkNCHK/7M wFWvckw/5tPk6ZYDbcg8fM3AztM+1SeTci6pcgp/Vq8vhgV8vWGwuCo9qsFUY94GBuAU 2lik1SkiKMsViV7dRTjs9DowGgckC0uTRDjivYmrjmghrDWqikbfixvfQ0EI7LwCRN4X aXBg== X-Gm-Message-State: APjAAAXIz+aURqKvkuoFd3WJKqMLWxdSCz3c6kR8FK+YtFGZiIIysJug u5mUnmJVfDPUuHlNiVu5YmjihvXKF7feJJBTw1TCq9wk38k= X-Google-Smtp-Source: APXvYqz/tmJ+pGe87EMQTRTUpwqf6Ngw+NiVZJyTchO9P1L6QfzrDei94QYR0upA0gT0zgHN9sehnp59dBZaw99Hxjs= X-Received: by 2002:a05:6830:205a:: with SMTP id f26mr5173373otp.43.1574897599975; Wed, 27 Nov 2019 15:33:19 -0800 (PST) MIME-Version: 1.0 Date: Wed, 27 Nov 2019 20:33:08 -0300 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="00000000000001163e05985c6c3f" X-Envelope-From: Subject: register_shutdown_function() not supports private methods From: david.proweb@gmail.com (David Rodrigues) --00000000000001163e05985c6c3f Content-Type: text/plain; charset="UTF-8" Hi internals, I am using the register_shutdown_function() inside a class, and then I have created a private method to be called during shutdown. I have noted that if the method is public it works, but private does not. register_shutdown_function([ self::class, 'privateMethod' ]); // FAIL Warning: (Registered shutdown functions) Unable to call MyClass::privateMethod() - function does not exist in Unknown on line 0 In contrast, spl_autoload_register() will works independent if it is private or public. spl_autoload_register([ self::class, 'privateMethod' ]); // OK Example code: https://3v4l.org/lClJQ This case is applicable independent if method is static or not. My real case is that I am initializing a static method that will register some shutdowns events (that are static methods too). This shutdown function should be private, to avoid execution at a public scope. As workaround I am keeping it as public. So, there are some reason to it do not works like spl does? -- David Rodrigues --00000000000001163e05985c6c3f--