Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php use Carbon\CarbonImmutable; // First quarter: $now = (new CarbonImmutable('2025-02-28')); printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d')); // Second quarter: $now = (new CarbonImmutable('2025-04-01')); printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d')); // Third quarter: $now = (new CarbonImmutable('2025-07-01')); printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d')); // Fourth quarter (next year): $now = (new CarbonImmutable('2025-10-28')); printf("Day: %s\nNext quarter: %s\n\n", $now->format('Y-m-d'), $now->addQuarter()->startOfQuarter()->format('Y-m-d'));
Copy Clear