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); }); */ }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.10.0160.00816.70
8.5.00.0140.00920.07
8.4.150.0030.00014.05
8.4.140.0210.00917.60
8.4.130.0060.00317.97
8.4.120.0060.00624.10
8.4.110.0100.00922.45
8.4.100.0110.01018.03
8.4.90.0040.00820.66
8.4.80.0120.00919.07
8.4.70.0110.01020.72
8.4.60.0080.01119.11
8.4.50.0110.00823.89
8.4.40.0100.01019.46
8.4.30.0050.00317.68
8.4.20.0100.01017.80
8.4.10.0130.00619.78
8.3.280.0120.00918.54
8.3.270.0140.00916.79
8.3.260.0030.00617.40
8.3.250.0140.00518.80
8.3.240.0070.00216.69
8.3.230.0140.00716.56
8.3.220.0090.00918.94
8.3.210.0120.00716.84
8.3.200.0040.00516.70
8.3.190.0120.00817.10
8.3.180.0120.00618.82
8.3.170.0070.01116.64
8.3.160.0070.01017.09
8.3.150.0030.01317.02
8.3.140.0090.00020.61
8.3.130.0080.00022.06
8.3.120.0060.00319.02
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0040.01126.77
8.3.80.0030.00718.31
8.3.70.0090.01216.58
8.3.60.0150.00718.18
8.3.50.0090.01016.54
8.3.40.0090.00618.84
8.3.30.0000.01418.59
8.3.20.0000.00721.94
8.3.10.0040.00421.90
8.3.00.0080.00019.78
8.2.290.0110.00820.51
8.2.280.0060.00518.42
8.2.270.0100.01018.40
8.2.260.0060.01216.91
8.2.250.0000.01518.55
8.2.240.0130.00318.68
8.2.230.0070.01322.58
8.2.220.0100.01437.54
8.2.210.0000.00926.77
8.2.200.0030.00616.75
8.2.190.0080.00816.61
8.2.180.0060.01225.92
8.2.170.0150.00319.09
8.2.160.0140.00022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0030.00520.47
8.2.120.0080.00026.16
8.2.110.0040.00420.60
8.2.100.0040.00717.84
8.2.90.0040.00419.70
8.2.80.0000.00917.97
8.2.70.0040.00418.05
8.2.60.0090.00018.09
8.2.50.0060.00318.10
8.2.40.0090.00022.20
8.2.30.0000.00719.27
8.2.20.0050.00218.09
8.2.10.0040.00418.09
8.2.00.0000.00718.01
8.1.330.0160.00422.03
8.1.320.0140.00916.34
8.1.310.0100.00316.39
8.1.300.0080.00017.85
8.1.290.0060.00330.84
8.1.280.0090.01325.92
8.1.270.0070.01320.56
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0070.01023.77
8.1.230.0040.00822.61
8.1.220.0050.00317.76
8.1.210.0070.00418.77
8.1.200.0060.00317.36
8.1.190.0090.00017.22
8.1.180.0050.00318.10
8.1.170.0030.00518.84
8.1.160.0050.00318.78
8.1.150.0000.00820.29
8.1.140.0070.00019.45
8.1.130.0040.00420.60
8.1.120.0000.00717.44
8.1.110.0080.00017.41
8.1.100.0050.00317.45
8.1.90.0050.00517.46
8.1.80.0040.00417.39
8.1.70.0030.00317.40
8.1.60.0000.00817.44
8.1.50.0000.00717.53
8.1.40.0040.00717.60
8.1.30.0000.00817.74
8.1.20.0020.00517.73
8.1.10.0090.00017.61
8.1.00.0060.00317.60
8.0.300.0020.00521.52
8.0.290.0040.00416.88
8.0.280.0040.00418.48
8.0.270.0030.00317.25
8.0.260.0030.00318.92
8.0.250.0000.01017.06
8.0.240.0040.00416.91
8.0.230.0030.00317.07
8.0.220.0030.00616.84
8.0.210.0030.00316.81
8.0.200.0030.00516.95
8.0.190.0040.00417.02
8.0.180.0040.00417.00
8.0.170.0060.00317.04
8.0.160.0070.00016.88
8.0.150.0040.00416.93
8.0.140.0040.00416.89
8.0.130.0060.00013.34
8.0.120.0030.00616.95
8.0.110.0040.00416.95
8.0.100.0000.00716.97
8.0.90.0070.00016.87
8.0.80.0070.01016.96
8.0.70.0040.00416.96
8.0.60.0000.00816.88
8.0.50.0030.00616.87
8.0.30.0130.00517.03
8.0.20.0120.00717.40
8.0.10.0040.00417.02
8.0.00.0110.00716.74
7.4.330.0000.00515.55
7.4.320.0030.00316.61
7.4.300.0000.00716.53
7.4.290.0030.00616.54
7.4.280.0040.00416.66
7.4.270.0030.00616.45
7.4.260.0080.00016.46
7.4.250.0000.00816.63
7.4.240.0040.00416.53
7.4.230.0020.00516.72
7.4.220.0100.01316.43
7.4.210.0080.00516.56
7.4.200.0000.00716.72
7.4.160.0090.00916.60
7.4.150.0060.01117.40
7.4.140.0090.01417.86
7.4.130.0090.01216.74
7.4.120.0120.00816.54
7.4.110.0100.01316.44
7.4.100.0190.00416.63
7.4.90.0060.01316.73
7.4.80.0210.00019.39
7.4.70.0150.00416.39
7.4.60.0070.01416.54
7.4.50.0060.00916.72
7.4.40.0070.01016.52
7.4.30.0150.00716.25
7.4.00.0070.01014.98
7.3.330.0000.00613.38
7.3.320.0030.00313.34
7.3.310.0030.00316.21
7.3.300.0070.00016.43
7.3.290.0090.00916.37
7.3.280.0080.00916.38
7.3.270.0180.00017.40
7.3.260.0060.01116.59
7.3.250.0160.00416.63
7.3.240.0120.00916.41
7.3.230.0070.01016.37
7.3.210.0030.01316.43
7.3.200.0030.01216.26
7.3.190.0040.01216.57
7.3.180.0030.01816.24
7.3.170.0160.00016.45
7.3.160.0160.00016.57
7.2.330.0120.00616.65
7.2.320.0060.01116.28
7.2.310.0040.01416.71
7.2.300.0070.01016.34
7.2.290.0060.01316.76
7.2.110.0150.00416.41
7.2.60.0000.01416.46
7.2.00.0060.00618.93
7.1.200.0070.00715.67
7.1.70.0040.00816.83
7.1.60.1070.00733.32
7.1.50.1130.01733.04
7.1.40.1330.01332.63
7.1.30.1500.02032.43
7.1.20.1030.01732.59
7.1.10.0970.01014.79
7.1.00.0870.01014.92
7.0.200.1130.01314.81
7.0.190.1130.00714.81
7.0.180.0700.01314.52
7.0.170.1530.00714.26
7.0.160.1600.01314.33
7.0.150.1000.00714.33
7.0.140.1130.00714.59
7.0.130.1300.01014.59
7.0.120.1070.01714.70
7.0.110.0930.01314.33
7.0.100.1130.01014.39
7.0.90.1070.01314.18
7.0.80.1000.02014.42
7.0.70.0830.01014.33
7.0.60.1000.01314.25
7.0.50.1200.01014.69
7.0.40.0930.01014.57
7.0.30.1200.01314.78
7.0.20.1030.00714.44
7.0.10.1370.01014.43
7.0.00.1200.00714.49

preferences:
38.59 ms | 403 KiB | 5 Q