3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = Auth::user(); $now = new DateTime(); $then = Session::get('user_last_login'); if (Session::has('notifications.last_retrieve')) { $then = Session::get('notifications.last_retrieve'); } //Adjusting the time for the notification to work. $then->modify('+1 second'); //Publications from sent friendship user $published_books1 = DB::table('published_books as a') ->join('user_relationships as b', 'a.user_id', '=', 'b.user_id') #->join('books as d', 'a.book_id', '=', 'd.id') ->join('users as e', 'a.user_id', '=', 'e.id') ->join('people as f', 'e.id', '=', 'f.user_id') ->where('b.request_status', $acknowledged_id) ->where(function ($query) use ($user) { $query->where('b.requester_id', $user->id); }) ->whereBetween('a.creted_at', [$then, $now]) ->where('e.username', '<>', Auth::user()->username) ->groupBy('a.id', 'e.id') ->select(DB::raw("concat(f.firstname, ' ', f.lastname) as name"), 'e.username', 'a.published_book_title as title', 'a.id'); if ($published_books1->count() > 0) { $notifications['published_books1'] = $published_books1->get(); /*Mail::send('emails.registro', array('key' => 'value'), function($message) { $message->subject('Bienvenido a la gran experiencia.'); $message->from(env('CONTACT_MAIL'), env('CONTACT_NAME')); $message->to(Auth::user()->email); }); */ } //Publications from received friendship users $published_books2 = DB::table('published_books as a') ->join('user_relationships as c', 'a.user_id', '=', 'c.requester_id') #->join('books as d', 'a.book_id', '=', 'd.id') ->join('users as e', 'a.user_id', '=', 'e.id') ->join('people as f', 'e.id', '=', 'f.user_id') ->where('c.request_status', $acknowledged_id) ->where('c.request_status', $acknowledged_id) ->where(function ($query) use ($user) { $query->where('c.requester_id', $user->id) ->orWhere('c.user_id', $user->id); }) ->whereBetween('a.creted_at', [$then, $now]) ->where('e.username', '<>', Auth::user()->username) ->groupBy('a.id', 'e.id') ->select(DB::raw("concat(f.firstname, ' ', f.lastname) as name"), 'e.username', 'a.published_book_title as title', 'a.id'); //Synchronizing to the former time $then->modify('-1 second'); if ($published_books2->count() > 0) { $notifications['published_books2'] = $published_books2->get(); /*Mail::send('emails.registro', array('key' => 'value'), function($message) { $message->subject('Bienvenido a la gran experiencia.'); $message->from(env('CONTACT_MAIL'), env('CONTACT_NAME')); $message->to(Auth::user()->email); }); */ }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Fatal error: Uncaught Error: Class "Auth" not found in /in/dJaUY:3 Stack trace: #0 {main} thrown in /in/dJaUY on line 3
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'Auth' not found in /in/dJaUY:3 Stack trace: #0 {main} thrown in /in/dJaUY on line 3
Process exited with code 255.

preferences:
188.51 ms | 410 KiB | 5 Q