3v4l.org

run code in 300+ PHP versions simultaneously
<?php $st_array = array(); $st_data1['id'] = 1; $st_data1['title'] = 'Jane doe'; $st_data1['disk'] = '1,3,2'; array_push($st_array, $st_data1); $rc_disk_id = '1,3'; $st_data2['id'] = 2; $st_data2['title'] = 'Jane Smith'; $st_data2['disk'] = '3,1,4'; array_push($st_array, $st_data2); foreach($st_array as $st_data) { $rc_disk_ids = explode(",",$rc_disk_id); $st_disk_ids = explode(',', $st_data['disk']); $match = array_diff($rc_disk_ids, $st_disk_ids); if (empty($match)) { echo "\nFound\n"; print_r($st_data); } else { echo "Nope!"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 49
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 49
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/9JhFQ
function name:  (null)
number of ops:  51
compiled vars:  !0 = $st_array, !1 = $st_data1, !2 = $rc_disk_id, !3 = $st_data2, !4 = $st_data, !5 = $rc_disk_ids, !6 = $st_disk_ids, !7 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !1, 'id'
          2        OP_DATA                                                  1
    5     3        ASSIGN_DIM                                               !1, 'title'
          4        OP_DATA                                                  'Jane+doe'
    6     5        ASSIGN_DIM                                               !1, 'disk'
          6        OP_DATA                                                  '1%2C3%2C2'
    7     7        INIT_FCALL                                               'array_push'
          8        SEND_REF                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
    9    11        ASSIGN                                                   !2, '1%2C3'
   11    12        ASSIGN_DIM                                               !3, 'id'
         13        OP_DATA                                                  2
   12    14        ASSIGN_DIM                                               !3, 'title'
         15        OP_DATA                                                  'Jane+Smith'
   13    16        ASSIGN_DIM                                               !3, 'disk'
         17        OP_DATA                                                  '3%2C1%2C4'
   14    18        INIT_FCALL                                               'array_push'
         19        SEND_REF                                                 !0
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                                 
   17    22      > FE_RESET_R                                       $18     !0, ->49
         23    > > FE_FETCH_R                                               $18, !4, ->49
   18    24    >   INIT_FCALL                                               'explode'
         25        SEND_VAL                                                 '%2C'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $19     
         28        ASSIGN                                                   !5, $19
   19    29        INIT_FCALL                                               'explode'
         30        SEND_VAL                                                 '%2C'
         31        FETCH_DIM_R                                      ~21     !4, 'disk'
         32        SEND_VAL                                                 ~21
         33        DO_ICALL                                         $22     
         34        ASSIGN                                                   !6, $22
   20    35        INIT_FCALL                                               'array_diff'
         36        SEND_VAR                                                 !5
         37        SEND_VAR                                                 !6
         38        DO_ICALL                                         $24     
         39        ASSIGN                                                   !7, $24
   21    40        ISSET_ISEMPTY_CV                                         !7
         41      > JMPZ                                                     ~26, ->47
   22    42    >   ECHO                                                     '%0AFound%0A'
   23    43        INIT_FCALL                                               'print_r'
         44        SEND_VAR                                                 !4
         45        DO_ICALL                                                 
   21    46      > JMP                                                      ->48
   26    47    >   ECHO                                                     'Nope%21'
   17    48    > > JMP                                                      ->23
         49    >   FE_FREE                                                  $18
   28    50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.85 ms | 1461 KiB | 17 Q