|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2020-07-10 12:11 UTC] nikic@php.net
 
-Summary: static return type: message and stacktrace wrong for
          Uncaught TypeError
+Summary: Use late binding scope instead of scope in stack
          trace
-Type:    Bug
+Type:    Feature/Change Request
  [2020-07-10 12:11 UTC] nikic@php.net
  [2020-07-19 12:03 UTC] si dot schubert at live dot de
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 02:00:02 2025 UTC | 
Description: ------------ the message and stack trace references the wrong class Test script: --------------- class A { public static function new(): static { return new self(); } } class B extends A { } B::new(); Expected result: ---------------- Fatal error: Uncaught TypeError: B::new(): Return value must be of type B, A returned in /app/bin/runner:8 Stack trace: #0 /app/bin/runner(16): B::new() #1 {main} thrown in /app/bin/runner on line 8 Actual result: -------------- Fatal error: Uncaught TypeError: A::new(): Return value must be of type B, A returned in /app/bin/runner:8 Stack trace: #0 /app/bin/runner(16): A::new() #1 {main} thrown in /app/bin/runner on line 8