- Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- string(3) "bar" string(3) "baz"
<?php
final class Foo
{
private $foo;
public function __construct(string $foo)
{
$this->foo = $foo;
}
public function getFoo(): string
{
return $this->foo;
}
}
$foo = new Foo('bar');
var_dump($foo->getFoo());
$foo->__construct('baz');
var_dump($foo->getFoo());