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 ['sp_id' => $id, 'specifications_name' => $name]) { 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>', $name, $id, in_array($id, $checked) ? 'checked' : '' ); } echo "</ul>";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 27
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 27
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/OsnrG
function name:  (null)
number of ops:  30
compiled vars:  !0 = $checked, !1 = $id, !2 = $name
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                                             $3      
          4        ASSIGN                                                       !0, $3
   16     5        ECHO                                                         '%3Cul%3E'
   17     6        INIT_FCALL                                                   'getgeneralspecifications'
          7        DO_FCALL                                          0  $5      
          8      > FE_RESET_R                                           $6      $5, ->27
          9    > > FE_FETCH_R                                                   $6, $7, ->27
         10    >   FETCH_LIST_R                                         $8      $7, 'sp_id'
         11        ASSIGN                                                       !1, $8
         12        FETCH_LIST_R                                         $10     $7, 'specifications_name'
         13        ASSIGN                                                       !2, $10
         14        FREE                                                         $7
   18    15        INIT_FCALL                                                   'printf'
   19    16        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    17        SEND_VAR                                                     !2
   30    18        SEND_VAR                                                     !1
   31    19        FRAMELESS_ICALL_2                in_array            ~12     !1, !0
         20      > JMPZ                                                         ~12, ->23
         21    >   QM_ASSIGN                                            ~13     'checked'
         22      > JMP                                                          ->24
         23    >   QM_ASSIGN                                            ~13     ''
         24    >   SEND_VAL                                                     ~13
   18    25        DO_ICALL                                                     
   17    26      > JMP                                                          ->9
         27    >   FE_FREE                                                      $6
   34    28        ECHO                                                         '%3C%2Ful%3E'
         29      > RETURN                                                       1

Function getgeneralspecifications:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OsnrG
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:
126.38 ms | 486 KiB | 10 Q