Found such a function on the Internet, help to understand the syntax of its output:

I could not find a description in which cases the new operator is used and it is not clear what the $ base-> add construct does

function get_easter_datetime($year) { $base = new DateTime("$year-03-21"); $days = easter_days($year); return $base->add(new DateInterval("P{$days}D")); } 

Thanks in advance =)

    1 answer 1

    Learn the basics of PHP

    To create an instance of a class, the new directive is used.

    $base->add(...) calls the $base->add(...) method of the add method

    http://php.net/manual/ru/language.oop5.basic.php

    • I understand, I will disassemble, I have not reached this part yet, thanks) - Vlad