3v4l.org

run code in 300+ PHP versions simultaneously
<?php $certidoes = array( array( 'id_certidao' => 1, 'checked' => 1 ), array( 'id_certidao' => 2, 'checked' => 0 ), array( 'id_certidao' => 3, 'checked' => 1 ) ); foreach ($certidoes as $certidao) { $checked = ""; if ($certidao['checked']) { $checked = "checked"; } echo '<input type="checkbox" id="check_'.$certidao['id_certidao'].'" name="check['.$certidao['id_certidao'].']" ' . $checked . ' value="1" /><br /><br />'; } //Dados para teste $_POST['check'] = array( 0 => 1, 1 => 3 ); $_POST['emissao'] = array( 1 => '10/10/2013', 2 => '11/10/2013', 3 => '12/10/2013' ); $_POST['validade'] = array( 1 => '10/10/2013', 2 => '10/11/2013', 3 => '10/12/2013' ); if (isset($_POST['check'])) { foreach ($_POST['check'] as $id) { $id_certidao = filter_var($id, FILTER_SANITIZE_NUMBER_INT); $emissao = filter_var($_POST['emissao'][$id_certidao], FILTER_SANITIZE_STRING); $validade = filter_var($_POST['validade'][$id_certidao], FILTER_SANITIZE_STRING); $insert = "INSERT INTO tb_certidao VALUES ( '$id_certidao', '$emissao', '$validade' )"; echo $insert.'<br><br>'; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 67
Branch analysis from position: 30
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 66
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 66
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 66
Branch analysis from position: 67
Branch analysis from position: 17
filename:       /in/33uT0
function name:  (null)
number of ops:  68
compiled vars:  !0 = $certidoes, !1 = $certidao, !2 = $checked, !3 = $id, !4 = $id_certidao, !5 = $emissao, !6 = $validade, !7 = $insert
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   17     1      > FE_RESET_R                                       $9      !0, ->17
          2    > > FE_FETCH_R                                               $9, !1, ->17
   18     3    >   ASSIGN                                                   !2, ''
   19     4        FETCH_DIM_R                                      ~11     !1, 'checked'
          5      > JMPZ                                                     ~11, ->7
   20     6    >   ASSIGN                                                   !2, 'checked'
   23     7    >   FETCH_DIM_R                                      ~13     !1, 'id_certidao'
          8        CONCAT                                           ~14     '%3Cinput+type%3D%22checkbox%22+id%3D%22check_', ~13
          9        CONCAT                                           ~15     ~14, '%22+name%3D%22check%5B'
         10        FETCH_DIM_R                                      ~16     !1, 'id_certidao'
         11        CONCAT                                           ~17     ~15, ~16
         12        CONCAT                                           ~18     ~17, '%5D%22+'
         13        CONCAT                                           ~19     ~18, !2
         14        CONCAT                                           ~20     ~19, '+value%3D%221%22+%2F%3E%3Cbr+%2F%3E%3Cbr+%2F%3E'
         15        ECHO                                                     ~20
   17    16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $9
   27    18        FETCH_W                      global              $21     '_POST'
         19        ASSIGN_DIM                                               $21, 'check'
   28    20        OP_DATA                                                  <array>
   32    21        FETCH_W                      global              $23     '_POST'
         22        ASSIGN_DIM                                               $23, 'emissao'
   33    23        OP_DATA                                                  <array>
   38    24        FETCH_W                      global              $25     '_POST'
         25        ASSIGN_DIM                                               $25, 'validade'
   39    26        OP_DATA                                                  <array>
   44    27        FETCH_IS                                         ~27     '_POST'
         28        ISSET_ISEMPTY_DIM_OBJ                         0          ~27, 'check'
         29      > JMPZ                                                     ~28, ->67
   45    30    >   FETCH_R                      global              ~29     '_POST'
         31        FETCH_DIM_R                                      ~30     ~29, 'check'
         32      > FE_RESET_R                                       $31     ~30, ->66
         33    > > FE_FETCH_R                                               $31, !3, ->66
   46    34    >   INIT_FCALL                                               'filter_var'
         35        SEND_VAR                                                 !3
         36        SEND_VAL                                                 519
         37        DO_ICALL                                         $32     
         38        ASSIGN                                                   !4, $32
   47    39        INIT_FCALL                                               'filter_var'
         40        FETCH_R                      global              ~34     '_POST'
         41        FETCH_DIM_R                                      ~35     ~34, 'emissao'
         42        FETCH_DIM_R                                      ~36     ~35, !4
         43        SEND_VAL                                                 ~36
         44        SEND_VAL                                                 513
         45        DO_ICALL                                         $37     
         46        ASSIGN                                                   !5, $37
   48    47        INIT_FCALL                                               'filter_var'
         48        FETCH_R                      global              ~39     '_POST'
         49        FETCH_DIM_R                                      ~40     ~39, 'validade'
         50        FETCH_DIM_R                                      ~41     ~40, !4
         51        SEND_VAL                                                 ~41
         52        SEND_VAL                                                 513
         53        DO_ICALL                                         $42     
         54        ASSIGN                                                   !6, $42
   50    55        ROPE_INIT                                     7  ~45     'INSERT+INTO+tb_certidao%0A+++++++++++++++++++VALUES+%28%0A++++++++++++++++++++++%27'
   52    56        ROPE_ADD                                      1  ~45     ~45, !4
         57        ROPE_ADD                                      2  ~45     ~45, '%27%2C%0A++++++++++++++++++++++%27'
   53    58        ROPE_ADD                                      3  ~45     ~45, !5
         59        ROPE_ADD                                      4  ~45     ~45, '%27%2C%0A++++++++++++++++++++++%27'
   54    60        ROPE_ADD                                      5  ~45     ~45, !6
         61        ROPE_END                                      6  ~44     ~45, '%27%0A+++++++++++++++++++%29'
   50    62        ASSIGN                                                   !7, ~44
   57    63        CONCAT                                           ~50     !7, '%3Cbr%3E%3Cbr%3E'
         64        ECHO                                                     ~50
   45    65      > JMP                                                      ->33
         66    >   FE_FREE                                                  $31
   59    67    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
337.45 ms | 1405 KiB | 16 Q