2010-08-01 13:27:02 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #52484.2 (__set() ignores setting properties with empty names)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class A {
|
2020-02-03 21:52:20 +00:00
|
|
|
function __set($prop, $val) {
|
|
|
|
$this->$prop = $val;
|
|
|
|
}
|
2010-08-01 13:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$a = new A();
|
2016-03-23 17:57:59 +00:00
|
|
|
$prop = "\0";
|
2010-08-01 13:27:02 +00:00
|
|
|
|
|
|
|
$a->$prop = 2;
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2020-05-26 12:10:57 +00:00
|
|
|
Fatal error: Uncaught Error: Cannot access property starting with "\0" in %s:%d
|
2015-05-15 19:04:07 +00:00
|
|
|
Stack trace:
|
2016-03-23 17:57:59 +00:00
|
|
|
#0 %s(%d): A->__set('\x00', 2)
|
2015-05-15 19:04:07 +00:00
|
|
|
#1 {main}
|
|
|
|
thrown in %s on line %d
|