Bug #80562 [Opn]: set_error_handler does not handle the warning about "private final function"

From: Date: Tue, 29 Dec 2020 21:52:40 +0000
Subject: Bug #80562 [Opn]: set_error_handler does not handle the warning about "private final function"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231302@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80562&edit=1 ID: 80562 User updated by: the dot is dot medvedev at gmail dot com Reported by: the dot is dot medvedev at gmail dot com -Summary: set_error_handler does not handle the warning "Private methods cannot be..." +Summary: set_error_handler does not handle the warning about "private final function" Status: Open Type: Bug Package: *General Issues Operating System: Docker php:8.0.0-cli PHP Version: 8.0.0 Block user comment: N Private report: N New Comment: Change the summary Previous Comments: ------------------------------------------------------------------------ [2020-12-29 21:41:51] the dot is dot medvedev at gmail dot com Description: ------------ Running by docker inside the folder with index.php and Foo.php files: sudo docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:8.0.0-cli php index.php Test script: --------------- // index.php <?php set_error_handler(function ($errno, $errstr) { echo "Handler -> $errno, $errstr\n"; return true; }); // Checking the handler gettype($a); include 'Foo.php'; // Foo.php <?php class Foo { private final static function bar () { } } Expected result: ---------------- Handler -> Undefined variable $a Handler -> Private methods cannot be final as they are never overridden by other classes Actual result: -------------- Handler -> Undefined variable $a Warning: Private methods cannot be final as they are never overridden by other classes in /usr/src/myapp/Foo.php on line 3 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80562&edit=1

« previous php.bugs (#231302) next »