3v4l.org

run code in 500+ PHP versions simultaneously
<?php // le cache ??? $_SESSION ? $la_var_du_cache = array( 'id' => array(112, 93, 93, 11559), 'date' => array('20171123', '20180509', '20180508', '20180407'), 'heure' => array('2:00', '8:00', '8:00', '7:00'), 'num' => array( array('adulte' => 3, '60_ans_plus' => 0, '30_ans_moins' => 0 ), array('adulte' => 4, '60_ans_plus' => 0, '30_ans_moins' => 0 ), array('adulte' => 4, '60_ans_plus' => 0, '30_ans_moins' => 0 ), array('adulte' => 0, 'enfant' => 4), ), ); // date à rechercher $get_date_a_supprimer = '20171123'; // rechercher la date dans la colonne date $dateEkey = array_search($get_date_a_supprimer, $la_var_du_cache['date']); // si la recherche n'est pas en échec if($dateEkey !== false) { foreach($la_var_du_cache as $index => $pas_important) { // ou unset($get_date_in_cache[$index][$dateEkey]); array_splice($la_var_du_cache[$index], $dateEkey, 1); // détruire un élément à partir de $dateEkey } } else echo 'pas trouver<br>'; print_r($la_var_du_cache);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZGhL
function name:  (null)
number of ops:  27
compiled vars:  !0 = $la_var_du_cache, !1 = $get_date_a_supprimer, !2 = $dateEkey, !3 = $pas_important, !4 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
   16     1        ASSIGN                                                       !1, '20171123'
   19     2        INIT_FCALL                                                   'array_search'
          3        SEND_VAR                                                     !1
          4        FETCH_DIM_R                                          ~7      !0, 'date'
          5        SEND_VAL                                                     ~7
          6        DO_ICALL                                             $8      
          7        ASSIGN                                                       !2, $8
   21     8        TYPE_CHECK                                      1018          !2
          9      > JMPZ                                                         ~10, ->22
   22    10    > > FE_RESET_R                                           $11     !0, ->20
         11    > > FE_FETCH_R                                           ~12     $11, !3, ->20
         12    >   ASSIGN                                                       !4, ~12
   24    13        INIT_FCALL                                                   'array_splice'
         14        FETCH_DIM_W                                          $14     !0, !4
         15        SEND_REF                                                     $14
         16        SEND_VAR                                                     !2
         17        SEND_VAL                                                     1
         18        DO_ICALL                                                     
   22    19      > JMP                                                          ->11
         20    >   FE_FREE                                                      $11
   21    21      > JMP                                                          ->23
   27    22    >   ECHO                                                         'pas+trouver%3Cbr%3E'
   29    23    >   INIT_FCALL                                                   'print_r'
         24        SEND_VAR                                                     !0
         25        DO_ICALL                                                     
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.41 ms | 2363 KiB | 16 Q