Skip to content

object_properties_load() bypasses readonly property checks #19765

@TimWolla

Description

@TimWolla

Description

The following code:

<?php

$r = new \Random\Randomizer(new \Random\Engine\PcgOneseq128XslRr64());
$r->__unserialize([['engine' => new \Random\Engine\Xoshiro256StarStar()]]);
var_dump($r->engine::class);

Resulted in this output:

string(32) "Random\Engine\Xoshiro256StarStar"

But I expected this output instead:

Error: Cannot modify readonly property Random\Randomizer::$engine

PHP Version

git master (probably any version)

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions