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'); //Synchronizing to the former time $then->modify('-1 second'); 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); }); */ } //Adjusting the time for the notification to work. $then->modify('+1 second'); //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.0140.00716.77
8.5.00.0130.01020.32
8.4.160.0150.00919.89
8.4.150.0010.00114.05
8.4.140.0120.00917.89
8.4.130.0110.00918.64
8.4.120.0140.00620.61
8.4.110.0100.00718.78
8.4.100.0120.00817.79
8.4.90.0150.00617.88
8.4.80.0140.00519.59
8.4.70.0120.00717.96
8.4.60.0140.00718.70
8.4.50.0120.01018.53
8.4.40.0070.01319.52
8.4.30.0050.00317.80
8.4.20.0170.00317.91
8.4.10.0130.00719.58
8.3.280.0120.01118.50
8.3.270.0220.01116.39
8.3.260.0130.00716.74
8.3.250.0120.00717.16
8.3.240.0100.00918.21
8.3.230.0130.00616.80
8.3.220.0100.00816.95
8.3.210.0060.00616.79
8.3.200.0070.00116.89
8.3.190.0100.00817.35
8.3.180.0130.00616.78
8.3.170.0000.01818.99
8.3.160.0150.00317.17
8.3.150.0150.00417.10
8.3.140.0130.00618.29
8.3.130.0040.00418.30
8.3.120.0090.00020.58
8.3.110.0110.00716.89
8.3.100.0000.00918.34
8.3.90.0080.00026.77
8.3.80.0030.00716.63
8.3.70.0120.00316.88
8.3.60.0070.01516.88
8.3.50.0100.00916.54
8.3.40.0120.00318.97
8.3.30.0070.00718.71
8.3.20.0000.00721.85
8.3.10.0080.00021.77
8.3.00.0080.00019.67
8.2.290.0130.00320.34
8.2.280.0120.00818.63
8.2.270.0090.00017.28
8.2.260.0040.00416.61
8.2.250.0060.00616.63
8.2.240.0110.00416.94
8.2.230.0080.00820.94
8.2.220.0080.00024.06
8.2.210.0000.00826.77
8.2.200.0060.00318.42
8.2.190.0140.00716.75
8.2.180.0040.01125.92
8.2.170.0110.00722.96
8.2.160.0080.00520.48
8.2.150.0090.00024.18
8.2.140.0050.00324.66
8.2.130.0050.00320.68
8.2.120.0040.00426.35
8.2.110.0090.00019.36
8.2.100.0080.00318.03
8.2.90.0090.00017.88
8.2.80.0040.00418.90
8.2.70.0040.00417.50
8.2.60.0050.00317.50
8.2.50.0080.00018.10
8.2.40.0000.00822.27
8.2.30.0060.00319.20
8.2.20.0040.00418.21
8.2.10.0000.00718.14
8.2.00.0000.00818.20
8.1.330.0120.00721.93
8.1.320.0100.00916.48
8.1.310.0150.00416.61
8.1.300.0060.00316.06
8.1.290.0060.00330.84
8.1.280.0090.00925.92
8.1.270.0040.00420.63
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00922.19
8.1.230.0000.01121.02
8.1.220.0060.00318.70
8.1.210.0080.00018.77
8.1.200.0050.00317.48
8.1.190.0030.00617.13
8.1.180.0030.00518.10
8.1.170.0060.00318.72
8.1.160.0000.00818.76
8.1.150.0000.00720.43
8.1.140.0040.00419.54
8.1.130.0080.00018.85
8.1.120.0040.00417.32
8.1.110.0030.00517.30
8.1.100.0020.00517.41
8.1.90.0000.00817.46
8.1.80.0030.00617.47
8.1.70.0020.00517.43
8.1.60.0050.00317.43
8.1.50.0000.00817.47
8.1.40.0000.01217.42
8.1.30.0040.00417.72
8.1.20.0000.00817.65
8.1.10.0080.00017.49
8.1.00.0030.00617.48
8.0.300.0040.00420.15
8.0.290.0070.00017.00
8.0.280.0030.00318.47
8.0.270.0070.00016.91
8.0.260.0000.00818.82
8.0.250.0000.00917.01
8.0.240.0000.00816.98
8.0.230.0030.00317.00
8.0.220.0040.00416.99
8.0.210.0030.00316.86
8.0.200.0000.00817.02
8.0.190.0030.00617.02
8.0.180.0040.00417.03
8.0.170.0070.00017.00
8.0.160.0030.00416.97
8.0.150.0000.00716.90
8.0.140.0000.00716.94
8.0.130.0030.00313.44
8.0.120.0080.00016.85
8.0.110.0040.00416.80
8.0.100.0040.00417.06
8.0.90.0080.00017.02
8.0.80.0060.00916.94
8.0.70.0040.00416.98
8.0.60.0050.00316.94
8.0.50.0090.00016.85
8.0.30.0080.00917.05
8.0.20.0140.00517.40
8.0.10.0040.00417.07
8.0.00.0120.01216.63
7.4.330.0020.00215.55
7.4.320.0000.00716.54
7.4.300.0000.00716.44
7.4.290.0040.00416.57
7.4.280.0040.00416.61
7.4.270.0100.00016.63
7.4.260.0040.00416.49
7.4.250.0080.00016.50
7.4.240.0080.00016.54
7.4.230.0050.00216.63
7.4.220.0100.01016.63
7.4.210.0070.00716.48
7.4.200.0040.00416.36
7.4.160.0090.00616.54
7.4.150.0130.01317.40
7.4.140.0120.01017.86
7.4.130.0140.01116.63
7.4.120.0100.01316.56
7.4.110.0060.01316.66
7.4.100.0100.00716.46
7.4.90.0100.00716.57
7.4.80.0090.01219.39
7.4.70.0130.00916.66
7.4.60.0080.00816.54
7.4.50.0000.01216.61
7.4.40.0120.00416.59
7.4.30.0170.00716.57
7.4.00.0110.00414.95
7.3.330.0000.00513.38
7.3.320.0000.00513.25
7.3.310.0040.00416.38
7.3.300.0030.00316.35
7.3.290.0100.00616.36
7.3.280.0110.00716.35
7.3.270.0090.01217.40
7.3.260.0140.00416.46
7.3.250.0130.00616.46
7.3.240.0110.00816.35
7.3.230.0120.00616.63
7.3.210.0120.01216.46
7.3.200.0110.00916.36
7.3.190.0060.00916.54
7.3.180.0100.00716.65
7.3.170.0100.00916.45
7.3.160.0070.01416.59
7.3.10.0170.00016.19
7.3.00.0110.00516.42
7.2.330.0130.00616.47
7.2.320.0090.00916.61
7.2.310.0100.00716.58
7.2.300.0110.01216.57
7.2.290.0160.00316.72
7.2.130.0120.00316.30
7.2.120.0060.01316.63
7.2.110.0040.01116.17
7.2.100.0060.01316.40
7.2.90.0110.00816.56
7.2.80.0060.00716.52
7.2.70.0070.00716.48
7.2.60.0060.00816.63
7.2.50.0120.00416.61
7.2.40.0120.00616.38
7.2.30.0110.00316.14
7.2.20.0150.00616.40
7.2.10.0160.00016.27
7.2.00.0100.01016.61
7.1.250.0130.00715.29
7.1.200.0030.01015.67
7.1.70.0040.00416.76
7.1.60.0930.01333.35
7.1.50.0870.01332.87
7.1.40.1130.01032.54
7.1.30.1170.01332.59
7.1.20.1100.01732.57
7.1.10.0930.01014.53
7.1.00.1070.00714.83
7.0.200.0970.00714.87
7.0.190.0800.01314.75
7.0.180.0970.01314.15
7.0.170.1000.00714.34
7.0.160.1530.01314.45
7.0.150.0900.00314.52
7.0.140.1000.01014.50
7.0.130.1230.01314.73
7.0.120.1230.01014.60
7.0.110.1370.01014.57
7.0.100.0970.01014.54
7.0.90.0930.00714.54
7.0.80.1300.01314.42
7.0.70.1130.01314.47
7.0.60.1000.01014.27
7.0.50.1170.01314.65
7.0.40.1630.01314.49
7.0.30.0770.01314.52
7.0.20.0770.00314.42
7.0.10.0630.01714.58
7.0.00.0670.01014.44

preferences:
37.48 ms | 403 KiB | 5 Q