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


preferences:
142.15 ms | 1009 KiB | 17 Q