3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 2 => array ( 'name' => 'sitebackup_2019_07_21_10_02_67.zip', 'id' => '/restore_point_backups/sitebackup_2019_07_21_10_02_67.zip', 'created' => 1563787267, ), 1 => array ( 'name' => 'sitebackup_2019_07_21_10_00_38.zip', 'id' => '/restore_point_backups/sitebackup_2019_07_21_10_00_38.zip', 'created' => 1563787197, ), 0 => array ( 'name' => 'sitebackup_2019_07_19_09_48_16.zip', 'id' => '/restore_point_backups/sitebackup_2019_07_19_09_48_16.zip', 'created' => 1563787125, ), ); $array_2 = array ( 0 => array ( 'id' => 'C:\\xampp\\htdocs\\restore_point_backups_fagardesignscom\\files', 'name' => 'sitebackup_2019_07_19_08_52_37.zip', 'created' => 1563519157, ), 1 => array ( 'id' => 'C:\\xampp\\htdocs\\restore_point_backups_fagardesignscom\\files', 'name' => 'sitebackup_2019_07_19_09_48_16.zip', 'created' => 1563522496, ), 2 => array ( 'id' => 'C:\\xampp\\htdocs\\restore_point_backups_fagardesignscom\\files', 'name' => 'sitebackup_2019_07_21_10_00_38.zip', 'created' => 1563696044, ), 3 => array ( 'id' => 'C:\\xampp\\htdocs\\restore_point_backups_fagardesignscom\\files', 'name' => 'sitebackup_2019_07_21_10_02_67.zip', 'created' => 1563696184, ), 4 => array ( 'id' => 'C:\\xampp\\htdocs\\restore_point_backups_fagardesignscom\\files', 'name' => 'sitebackup_2019_07_21_10_12_29.zip', 'created' => 1563696754, ), 5 => array ( 'id' => 'C:\\xampp\\htdocs\\restore_point_backups_fagardesignscom\\files', 'name' => 'sitebackup_2019_Jul_21_10_17_58.zip', 'created' => 1563697083, ), ); //Get the column value from array 2 ny name $array2_col = array_column($array_2, 'name'); foreach($array as $key=>$value){ //if array1 name value exist in array 2 get that key and delete from array 2 using unset. $key = array_search($value['name'], $array2_col); if($key){ unset($array_2[$key]); } } echo "<pre>"; print_r(array_values($array_2));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 18
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/tlicM
function name:  (null)
number of ops:  28
compiled vars:  !0 = $array, !1 = $array_2, !2 = $array2_col, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   25     1        ASSIGN                                                   !1, <array>
   69     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 'name'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   70     7      > FE_RESET_R                                       $9      !0, ->19
          8    > > FE_FETCH_R                                       ~10     $9, !3, ->19
          9    >   ASSIGN                                                   !4, ~10
   73    10        INIT_FCALL                                               'array_search'
         11        FETCH_DIM_R                                      ~12     !3, 'name'
         12        SEND_VAL                                                 ~12
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !4, $13
   74    16      > JMPZ                                                     !4, ->18
   75    17    >   UNSET_DIM                                                !1, !4
   70    18    > > JMP                                                      ->8
         19    >   FE_FREE                                                  $9
   79    20        ECHO                                                     '%3Cpre%3E'
   80    21        INIT_FCALL                                               'print_r'
         22        INIT_FCALL                                               'array_values'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $15     
         25        SEND_VAR                                                 $15
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.09 ms | 1006 KiB | 17 Q