|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2020-12-29 21:52 UTC] 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"
  [2020-12-29 21:52 UTC] the dot is dot medvedev at gmail dot com
  [2020-12-29 21:55 UTC] requinix@php.net
 
-Status: Open
+Status: Not a bug
  [2020-12-29 21:55 UTC] requinix@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
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