<?php

class Example
{
	public $properties;
	
    public function functionA(int $number): string
    {
        if (is_null($this->properties)) {
            return 'bar';
        }

        return $this->properties[$number]['from'] ?? 'bar';
    }
	
    public function functionB(int $number): string
    {
        return $this->properties[$number]['from'] ?? 'bar';
    }
}

$example = new Example();

/* Scenario with no value set */
$a = $example->functionA(1);
$b = $example->functionB(1);

var_dump($a, $b, $a === $b);

/* Scenario with value set */
$example->properties = [
	1 => [
		'from' => 'Foo'
	]
];

$a = $example->functionA(1);
$b = $example->functionB(1);

var_dump($a, $b, $a === $b);

