xref: /PHP-8.2/Zend/tests/bug52484.phpt (revision d30cd7d7)
1--TEST--
2Bug #52484 (__set() ignores setting properties with empty names)
3--FILE--
4<?php
5
6class A {
7    function __unset($prop) {
8        unset($this->$prop);
9    }
10}
11
12$a = new A();
13$prop = "\0";
14
15unset($a->$prop);
16
17?>
18--EXPECTF--
19Fatal error: Uncaught Error: Cannot access property starting with "\0" in %s:%d
20Stack trace:
21#0 %s(%d): A->__unset('\x00')
22#1 {main}
23  thrown in %s on line %d
24