Question from the PHP8 test

Create a new instance of a class using the `createFromWhatever()` method.

Medium

What will it be displayed?

<?php

class Foo
{
    public function createFromWhatever(): static
    {
        return new static();
    }
}

class Bar extends Foo
{
}


$bar = new Bar;
var_dump($bar->createFromWhatever());
Author: W3D TeamStatus: PublishedQuestion passed 354 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!