3v4l.org

run code in 300+ 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 = 30
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 30
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/OsnrG
function name:  (null)
number of ops:  33
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, ->30
          9    > > FE_FETCH_R                                               $6, $7, ->30
         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        INIT_FCALL                                               'in_array'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $12     
         23      > JMPZ                                                     $12, ->26
         24    >   QM_ASSIGN                                        ~13     'checked'
         25      > JMP                                                      ->27
         26    >   QM_ASSIGN                                        ~13     ''
         27    >   SEND_VAL                                                 ~13
   18    28        DO_ICALL                                                 
   17    29      > JMP                                                      ->9
         30    >   FE_FREE                                                  $6
   34    31        ECHO                                                     '%3C%2Ful%3E'
         32      > 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.0.0


preferences:
315.21 ms | 1020 KiB | 17 Q