<?php interface SplStackFacadeInterface { public static function fromArray(array $arr); } class SplStackFacade extends SplStack implements SplStackFacadeInterface { public static function fromArray(array $arr): SplStack { $splStack = new self(); array_map([$splStack, 'push'], $arr); return $splStack; } } var_dump(SplStackFacade::fromArray([1, 2, 3, 4]));
You have javascript disabled. You will not be able to edit any code.