Rakuten interview question

PHP oops