3v4l.org

run code in 300+ PHP versions simultaneously
<?php use App\Models\User; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Log; it('returns users with exactly $daysLeft days left, hour-precise', function () { $graceDays = 30; $daysLeft = 7; $now = now(); $users = []; for ($hour = 0; $hour < 24; $hour++) { $user = User::factory()->make([ 'email' => "exact_hour_{$hour}@example.net", ]); $user->forceFill([ // deleted_at = now - (graceDays - daysLeft) 'deleted_at' => $now->copy() ->subDays($graceDays) ->addDays($daysLeft) ->setHour($hour) ->setMinute(0) ->setSecond(0), ])->save(); $users[] = $user; } $outsideUser = User::factory()->make([ 'email' => "outside@example.net", ]); $outsideUser->forceFill([ 'deleted_at' => $now->copy()->subDays($graceDays - $daysLeft - 1), ])->save(); $result = User::deletionGraceImpending($daysLeft, true)->pluck('id'); foreach ($users as $user) { expect($result)->toContain($user->id); } expect($result)->not->toContain($outsideUser->id); });
Output for git.master_jit, git.master
Fatal error: Uncaught Error: Call to undefined function it() in /in/aeaA4:7 Stack trace: #0 {main} thrown in /in/aeaA4 on line 7
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.49 ms | 405 KiB | 5 Q