xref: /PHP-8.4/tests/lang/bug24573.phpt (revision d679f022)
1--TEST--
2Bug #24573 (debug_backtrace() crashes if $this is set to null)
3--FILE--
4<?php
5
6class Foo {
7  function Bar() {
8    $__this = $this;
9    $this = null;
10    debug_backtrace();
11    $this = $__this;
12  }
13}
14
15$f = new Foo;
16
17$f->Bar();
18
19echo "OK\n";
20
21?>
22--EXPECTF--
23Fatal error: Cannot re-assign $this in %s on line %d
24