3v4l.org

run code in 300+ PHP versions simultaneously
<?php function implode_conditions($query) { $query['conditions'] = !empty($query['conditions']) ? implode(" AND ", $query['conditions']) : ''; return $query; } print_r(implode_conditions([ 'conditions' => ["client_id = :client_id:", "user_id = :user_id:"], 'bind' => [ 'client_id' => 4, 'user_id' => 8 ] ]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XcUtY
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'implode_conditions'
    8     2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   13     6      > RETURN                                                   1

Function implode_conditions:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XcUtY
function name:  implode_conditions
number of ops:  16
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ISSET_ISEMPTY_DIM_OBJ                         1  ~2      !0, 'conditions'
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->11
          4    >   INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '+AND+'
          6        FETCH_DIM_R                                      ~4      !0, 'conditions'
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        QM_ASSIGN                                        ~6      $5
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~6      ''
         12    >   ASSIGN_DIM                                               !0, 'conditions'
         13        OP_DATA                                                  ~6
    4    14      > RETURN                                                   !0
    5    15*     > RETURN                                                   null

End of function implode_conditions

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.53 ms | 1398 KiB | 18 Q