3v4l.org

run code in 300+ PHP versions simultaneously
<?php //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); }); */ }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 70
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 140, Position 2 = 144
Branch analysis from position: 140
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 144
Branch analysis from position: 70
filename:       /in/egIi0
function name:  (null)
number of ops:  145
compiled vars:  !0 = $then, !1 = $published_books1, !2 = $acknowledged_id, !3 = $user, !4 = $now, !5 = $notifications, !6 = $published_books2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_METHOD_CALL                                         !0, 'modify'
          1        SEND_VAL_EX                                              '%2B1+second'
          2        DO_FCALL                                      0          
    7     3        INIT_STATIC_METHOD_CALL                                  'DB', 'table'
          4        SEND_VAL_EX                                              'published_books+as+a'
          5        DO_FCALL                                      0  $8      
    8     6        INIT_METHOD_CALL                                         $8, 'join'
          7        SEND_VAL_EX                                              'user_relationships+as+b'
          8        SEND_VAL_EX                                              'a.user_id'
          9        SEND_VAL_EX                                              '%3D'
         10        SEND_VAL_EX                                              'b.user_id'
         11        DO_FCALL                                      0  $9      
   10    12        INIT_METHOD_CALL                                         $9, 'join'
         13        SEND_VAL_EX                                              'users+as+e'
         14        SEND_VAL_EX                                              'a.user_id'
         15        SEND_VAL_EX                                              '%3D'
         16        SEND_VAL_EX                                              'e.id'
         17        DO_FCALL                                      0  $10     
   11    18        INIT_METHOD_CALL                                         $10, 'join'
         19        SEND_VAL_EX                                              'people+as+f'
         20        SEND_VAL_EX                                              'e.id'
         21        SEND_VAL_EX                                              '%3D'
         22        SEND_VAL_EX                                              'f.user_id'
         23        DO_FCALL                                      0  $11     
   12    24        INIT_METHOD_CALL                                         $11, 'where'
         25        SEND_VAL_EX                                              'b.request_status'
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0  $12     
   13    28        INIT_METHOD_CALL                                         $12, 'where'
         29        DECLARE_LAMBDA_FUNCTION                          ~13     [0]
         30        BIND_LEXICAL                                             ~13, !3
   16    31        SEND_VAL_EX                                              ~13
   13    32        DO_FCALL                                      0  $14     
   17    33        INIT_METHOD_CALL                                         $14, 'whereBetween'
         34        SEND_VAL_EX                                              'a.creted_at'
         35        INIT_ARRAY                                       ~15     !0
         36        ADD_ARRAY_ELEMENT                                ~15     !4
         37        SEND_VAL_EX                                              ~15
         38        DO_FCALL                                      0  $16     
   18    39        INIT_METHOD_CALL                                         $16, 'where'
         40        SEND_VAL_EX                                              'e.username'
         41        SEND_VAL_EX                                              '%3C%3E'
         42        CHECK_FUNC_ARG                                           
         43        INIT_STATIC_METHOD_CALL                                  'Auth', 'user'
         44        DO_FCALL                                      0  $17     
         45        FETCH_OBJ_FUNC_ARG                               $18     $17, 'username'
         46        SEND_FUNC_ARG                                            $18
         47        DO_FCALL                                      0  $19     
   19    48        INIT_METHOD_CALL                                         $19, 'groupBy'
         49        SEND_VAL_EX                                              'a.id'
         50        SEND_VAL_EX                                              'e.id'
         51        DO_FCALL                                      0  $20     
   20    52        INIT_METHOD_CALL                                         $20, 'select'
         53        INIT_STATIC_METHOD_CALL                                  'DB', 'raw'
         54        SEND_VAL_EX                                              'concat%28f.firstname%2C+%27+%27%2C+f.lastname%29+as+name'
         55        DO_FCALL                                      0  $21     
         56        SEND_VAR_NO_REF_EX                                       $21
         57        SEND_VAL_EX                                              'e.username'
         58        SEND_VAL_EX                                              'a.published_book_title+as+title'
         59        SEND_VAL_EX                                              'a.id'
         60        DO_FCALL                                      0  $22     
    7    61        ASSIGN                                                   !1, $22
   23    62        INIT_METHOD_CALL                                         !1, 'count'
         63        DO_FCALL                                      0  $24     
         64        IS_SMALLER                                               0, $24
         65      > JMPZ                                                     ~25, ->70
   24    66    >   INIT_METHOD_CALL                                         !1, 'get'
         67        DO_FCALL                                      0  $27     
         68        ASSIGN_DIM                                               !5, 'published_books1'
         69        OP_DATA                                                  $27
   37    70    >   INIT_STATIC_METHOD_CALL                                  'DB', 'table'
         71        SEND_VAL_EX                                              'published_books+as+a'
         72        DO_FCALL                                      0  $28     
   38    73        INIT_METHOD_CALL                                         $28, 'join'
         74        SEND_VAL_EX                                              'user_relationships+as+c'
         75        SEND_VAL_EX                                              'a.user_id'
         76        SEND_VAL_EX                                              '%3D'
         77        SEND_VAL_EX                                              'c.requester_id'
         78        DO_FCALL                                      0  $29     
   40    79        INIT_METHOD_CALL                                         $29, 'join'
         80        SEND_VAL_EX                                              'users+as+e'
         81        SEND_VAL_EX                                              'a.user_id'
         82        SEND_VAL_EX                                              '%3D'
         83        SEND_VAL_EX                                              'e.id'
         84        DO_FCALL                                      0  $30     
   41    85        INIT_METHOD_CALL                                         $30, 'join'
         86        SEND_VAL_EX                                              'people+as+f'
         87        SEND_VAL_EX                                              'e.id'
         88        SEND_VAL_EX                                              '%3D'
         89        SEND_VAL_EX                                              'f.user_id'
         90        DO_FCALL                                      0  $31     
   42    91        INIT_METHOD_CALL                                         $31, 'where'
         92        SEND_VAL_EX                                              'c.request_status'
         93        SEND_VAR_EX                                              !2
         94        DO_FCALL                                      0  $32     
   43    95        INIT_METHOD_CALL                                         $32, 'where'
         96        SEND_VAL_EX                                              'c.request_status'
         97        SEND_VAR_EX                                              !2
         98        DO_FCALL                                      0  $33     
   44    99        INIT_METHOD_CALL                                         $33, 'where'
        100        DECLARE_LAMBDA_FUNCTION                          ~34     [1]
        101        BIND_LEXICAL                                             ~34, !3
   48   102        SEND_VAL_EX                                              ~34
   44   103        DO_FCALL                                      0  $35     
   49   104        INIT_METHOD_CALL                                         $35, 'whereBetween'
        105        SEND_VAL_EX                                              'a.creted_at'
        106        INIT_ARRAY                                       ~36     !0
        107        ADD_ARRAY_ELEMENT                                ~36     !4
        108        SEND_VAL_EX                                              ~36
        109        DO_FCALL                                      0  $37     
   50   110        INIT_METHOD_CALL                                         $37, 'where'
        111        SEND_VAL_EX                                              'e.username'
        112        SEND_VAL_EX                                              '%3C%3E'
        113        CHECK_FUNC_ARG                                           
        114        INIT_STATIC_METHOD_CALL                                  'Auth', 'user'
        115        DO_FCALL                                      0  $38     
        116        FETCH_OBJ_FUNC_ARG                               $39     $38, 'username'
        117        SEND_FUNC_ARG                                            $39
        118        DO_FCALL                                      0  $40     
   51   119        INIT_METHOD_CALL                                         $40, 'groupBy'
        120        SEND_VAL_EX                                              'a.id'
        121        SEND_VAL_EX                                              'e.id'
        122        DO_FCALL                                      0  $41     
   52   123        INIT_METHOD_CALL                                         $41, 'select'
        124        INIT_STATIC_METHOD_CALL                                  'DB', 'raw'
        125        SEND_VAL_EX                                              'concat%28f.firstname%2C+%27+%27%2C+f.lastname%29+as+name'
        126        DO_FCALL                                      0  $42     
        127        SEND_VAR_NO_REF_EX                                       $42
        128        SEND_VAL_EX                                              'e.username'
        129        SEND_VAL_EX                                              'a.published_book_title+as+title'
        130        SEND_VAL_EX                                              'a.id'
        131        DO_FCALL                                      0  $43     
   37   132        ASSIGN                                                   !6, $43
   55   133        INIT_METHOD_CALL                                         !0, 'modify'
        134        SEND_VAL_EX                                              '-1+second'
        135        DO_FCALL                                      0          
   57   136        INIT_METHOD_CALL                                         !6, 'count'
        137        DO_FCALL                                      0  $46     
        138        IS_SMALLER                                               0, $46
        139      > JMPZ                                                     ~47, ->144
   58   140    >   INIT_METHOD_CALL                                         !6, 'get'
        141        DO_FCALL                                      0  $49     
        142        ASSIGN_DIM                                               !5, 'published_books2'
        143        OP_DATA                                                  $49
   67   144    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egIi0
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $query, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        INIT_METHOD_CALL                                         !0, 'where'
          3        SEND_VAL_EX                                              'b.requester_id'
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $2      !1, 'id'
          6        SEND_FUNC_ARG                                            $2
          7        DO_FCALL                                      0          
   16     8      > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egIi0
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $query, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   46     2        INIT_METHOD_CALL                                         !0, 'where'
          3        SEND_VAL_EX                                              'c.requester_id'
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $2      !1, 'id'
          6        SEND_FUNC_ARG                                            $2
          7        DO_FCALL                                      0  $3      
   47     8        INIT_METHOD_CALL                                         $3, 'orWhere'
          9        SEND_VAL_EX                                              'c.user_id'
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $4      !1, 'id'
         12        SEND_FUNC_ARG                                            $4
         13        DO_FCALL                                      0          
   48    14      > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.81 ms | 1020 KiB | 13 Q