This is an old revision of the document!

PHP RFC: StackFrame class

The debug_backtrace() function currently returns stack trace frames as an array of arrays with information about the file, line, class, type, object, args and function name as keys. This RFC proposes to add a debug_backtrace() alternative which returns an array of objects instead. This reduces memory usage and makes code operating on frames more readable.





Backward Incompatible Changes


Proposed PHP Version(s)

Next PHP 8.x

RFC Impact



To Existing Extensions


To Opcache


New Constants

Not yet.

Future Scope

This section details areas where the feature might be improved in future, but that are not currently proposed in this RFC.

Proposed Voting Choices

Include these so readers know where you are heading and can discuss the proposed voting options.

Patches and Tests

Links to any external patches and tests go here.

If there is no patch, make it clear who will create a patch, or whether a volunteer to help with implementation is needed.

Make it clear if the patch is intended to be the final patch, or is just a prototype.

For changes affecting the core language, you should also provide a patch for the language specification.


After the project is implemented, this section should contain

  1. the version(s) it was merged into
  2. a link to the git commit(s)
  3. a link to the PHP manual entry for the feature
  4. a link to the language specification section (if any)


Links to external references, discussions or RFCs

Rejected Features

Keep this updated with features that were discussed on the mail lists.

rfc/stack-frame-class.1594147131.txt.gz · Last modified: 2020/07/07 18:38 by brzuchal