3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getgeneralSpecifications() { return [ ['sp_id' => 1, 'specifications_name' => 'example 1'], ['sp_id' => 2, 'specifications_name' => 'example 2'], ['sp_id' => 3, 'specifications_name' => 'example 3'], ['sp_id' => 4, 'specifications_name' => 'example 4'], ['sp_id' => 5, 'specifications_name' => 'example 5'], ['sp_id' => 6, 'specifications_name' => 'example 6'], ]; } $checked = explode(',', '1,2,4'); echo "<ul>"; foreach (getgeneralSpecifications() as $row) { printf( '<li> <label>%s</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="%d" name="general_specification[]" %s> </div> </li>', $row['specifications_name'], $row['sp_id'], in_array($row['sp_id'], $checked) ? 'checked' : '' ); } echo "</ul>";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/LUMp3
function name:  (null)
number of ops:  28
compiled vars:  !0 = $checked, !1 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                                   'explode'
          1        SEND_VAL                                                     '%2C'
          2        SEND_VAL                                                     '1%2C2%2C4'
          3        DO_ICALL                                             $2      
          4        ASSIGN                                                       !0, $2
   16     5        ECHO                                                         '%3Cul%3E'
   17     6        INIT_FCALL                                                   'getgeneralspecifications'
          7        DO_FCALL                                          0  $4      
          8      > FE_RESET_R                                           $5      $4, ->25
          9    > > FE_FETCH_R                                                   $5, !1, ->25
   18    10    >   INIT_FCALL                                                   'printf'
   19    11        SEND_VAL                                                     '%3Cli%3E%0A++++++++++++%3Clabel%3E%25s%3C%2Flabel%3E%0A++++++++++++%3Cdiv+class%3D%22form-check%22%3E%0A++++++++++++++++%3Cinput+class%3D%22form-check-input+custom-checkbox+generalsinglecheck%22%0A+++++++++++++++++++++++type%3D%22checkbox%22%0A+++++++++++++++++++++++value%3D%22%25d%22%0A+++++++++++++++++++++++name%3D%22general_specification%5B%5D%22%0A+++++++++++++++++++++++%25s%3E%0A++++++++++++%3C%2Fdiv%3E%0A++++++++%3C%2Fli%3E'
   29    12        FETCH_DIM_R                                          ~6      !1, 'specifications_name'
         13        SEND_VAL                                                     ~6
   30    14        FETCH_DIM_R                                          ~7      !1, 'sp_id'
         15        SEND_VAL                                                     ~7
   31    16        FETCH_DIM_R                                          ~8      !1, 'sp_id'
         17        FRAMELESS_ICALL_2                in_array            ~9      ~8, !0
         18      > JMPZ                                                         ~9, ->21
         19    >   QM_ASSIGN                                            ~10     'checked'
         20      > JMP                                                          ->22
         21    >   QM_ASSIGN                                            ~10     ''
         22    >   SEND_VAL                                                     ~10
   18    23        DO_ICALL                                                     
   17    24      > JMP                                                          ->9
         25    >   FE_FREE                                                      $5
   34    26        ECHO                                                         '%3C%2Ful%3E'
         27      > RETURN                                                       1

Function getgeneralspecifications:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LUMp3
function name:  getgeneralSpecifications
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                       <array>
   12     1*     > RETURN                                                       null

End of function getgeneralspecifications

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128 ms | 486 KiB | 10 Q