Bug #80562 [NEW]: set_error_handler does not handle the warning "Private methods cannot be..."

From: Date: Tue, 29 Dec 2020 21:41:51 +0000
Subject: Bug #80562 [NEW]: set_error_handler does not handle the warning "Private methods cannot be..."
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231301@lists.php.net to get a copy of this message
From: the dot is dot medvedev at gmail dot com Operating system: Docker php:8.0.0-cli PHP version: 8.0.0 Package: *General Issues Bug Type: Bug Bug description:set_error_handler does not handle the warning "Private methods cannot be..." 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 bug report at https://bugs.php.net/bug.php?id=80562&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80562&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80562&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80562&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80562&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80562&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80562&r=support Expected behavior: https://bugs.php.net/fix.php?id=80562&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80562&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80562&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80562&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80562&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80562&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80562&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80562&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80562&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80562&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80562&r=mysqlcfg

« previous php.bugs (#231301) next »