3v4l.org

run code in 500+ PHP versions simultaneously
<?php $tableUniqueIds = [900845, 2381036, 2636066, 3879196, 5031833]; foreach ($tableUniqueIds as $tableUniqueId) { $sqlStatements[] = " UPDATE rbs_customer_payment_details cd SET cd.status_id = (SELECT cds.id FROM rbs_customer_payment_detail_statuses cds WHERE cds.status='rejected'), cd.updated_at = now() WHERE cd.id = $tableUniqueId"; $sqlStatements[] = " INSERT INTO rbs_customer_payment_detail_activities (customer_payment_detail_id, status_id, username, created_at, updated_at, reason) VALUES ( $tableUniqueId, (SELECT cds.id from rbs_customer_payment_detail_statuses cds where cds.status = 'rejected'), 'SYSTEM', now(), now(), 'Other: FUNDING-24509' );"; } $sql = '```SQL' . implode('', $sqlStatements); $sql .= '```'; echo $sql;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/Roag6
function name:  (null)
number of ops:  20
compiled vars:  !0 = $tableUniqueIds, !1 = $tableUniqueId, !2 = $sqlStatements, !3 = $sql
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
    6     1      > FE_RESET_R                                           $5      !0, ->13
          2    > > FE_FETCH_R                                                   $5, !1, ->13
    7     3    >   NOP                                                          
   11     4        FAST_CONCAT                                          ~7      '%0A++++++++++++UPDATE+rbs_customer_payment_details+cd+SET%0A++++++++++++++++cd.status_id+%3D+%28SELECT+cds.id+FROM+rbs_customer_payment_detail_statuses+cds+WHERE+cds.status%3D%27rejected%27%29%2C%0A++++++++++++++++cd.updated_at+%3D+now%28%29%0A++++++++++++WHERE+cd.id+%3D+', !1
    7     5        ASSIGN_DIM                                                   !2
   11     6        OP_DATA                                                      ~7
   13     7        ROPE_INIT                                         3  ~10     '%0A++++++++++++INSERT+INTO+rbs_customer_payment_detail_activities%0A++++++++++++++++%28customer_payment_detail_id%2C+status_id%2C+username%2C+created_at%2C+updated_at%2C+reason%29%0A++++++++++++VALUES+%28%0A++++++++++++++++'
   17     8        ROPE_ADD                                          1  ~10     ~10, !1
          9        ROPE_END                                          2  ~9      ~10, '%2C%0A++++++++++++++++%28SELECT+cds.id+from+rbs_customer_payment_detail_statuses+cds+where+cds.status+%3D+%27rejected%27%29%2C%0A++++++++++++++++%27SYSTEM%27%2C%0A++++++++++++++++now%28%29%2C%0A++++++++++++++++now%28%29%2C%0A++++++++++++++++%27Other%3A+FUNDING-24509%27%0A++++++++++++%29%3B'
   13    10        ASSIGN_DIM                                                   !2
   17    11        OP_DATA                                                      ~9
    6    12      > JMP                                                          ->2
         13    >   FE_FREE                                                      $5
   26    14        FRAMELESS_ICALL_2                implode             ~12     '', !2
         15        CONCAT                                               ~13     '%60%60%60SQL', ~12
         16        ASSIGN                                                       !3, ~13
   28    17        ASSIGN_OP                                         8          !3, '%60%60%60'
   29    18        ECHO                                                         !3
   30    19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
144.41 ms | 1569 KiB | 13 Q