3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { function joinIfNot(\Illuminate\Database\Eloquent\Builder $builder, string $table, string $one, string $operator = null, string $two = null, string $type = 'inner', bool $where = false) { foreach ($builder->getQuery()->joins as $joinClause) { if ($joinClause->table === $table) { return $builder; } } return $builder->join($table, $one, $operator, $two, $type, $where); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FP2vH
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                       1

Class A:
Function joinifnot:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/FP2vH
function name:  joinIfNot
number of ops:  29
compiled vars:  !0 = $builder, !1 = $table, !2 = $one, !3 = $operator, !4 = $two, !5 = $type, !6 = $where, !7 = $joinClause
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
          3        RECV_INIT                                            !3      null
          4        RECV_INIT                                            !4      null
          5        RECV_INIT                                            !5      'inner'
          6        RECV_INIT                                            !6      <false>
    7     7        INIT_METHOD_CALL                                             !0, 'getQuery'
          8        DO_FCALL                                          0  $8      
          9        FETCH_OBJ_R                                          ~9      $8, 'joins'
         10      > FE_RESET_R                                           $10     ~9, ->18
         11    > > FE_FETCH_R                                                   $10, !7, ->18
    8    12    >   FETCH_OBJ_R                                          ~11     !7, 'table'
         13        IS_IDENTICAL                                                 !1, ~11
         14      > JMPZ                                                         ~12, ->17
    9    15    >   FE_FREE                                                      $10
         16      > RETURN                                                       !0
    7    17    > > JMP                                                          ->11
         18    >   FE_FREE                                                      $10
   13    19        INIT_METHOD_CALL                                             !0, 'join'
         20        SEND_VAR_EX                                                  !1
         21        SEND_VAR_EX                                                  !2
         22        SEND_VAR_EX                                                  !3
         23        SEND_VAR_EX                                                  !4
         24        SEND_VAR_EX                                                  !5
         25        SEND_VAR_EX                                                  !6
         26        DO_FCALL                                          0  $13     
         27      > RETURN                                                       $13
   14    28*     > RETURN                                                       null

End of function joinifnot

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.89 ms | 3315 KiB | 13 Q