3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "client_id address address_2 city street phone phone_2 mobile mobile_2 email_2 web_address web_address_2 sex_id sex_orientation_id date_of_birth ancestry_id country_id height PRIMARY weight figure_id breast_size_id eye_color_id hair_color_id has_tattoo has_piercings body_hair_id intimate_id is_smoker is_alcoholic canton_id zip_code local_id first_name last_name text nickname"; $a = explode("\n", $s); $b = []; foreach($a as $key=>$temp) { if (strpos($temp, 'id') !== false) { $b[$temp] = [ 'valid' => 'int', 'label' => ucfirst(str_replace('_', ' ', $temp))]; } else { $b[$temp] = [ 'valid' => 'min(1)', 'label' => ucfirst(str_replace('_', ' ', $temp))]; } } echo $a;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 42
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 42
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/a5Wnq
function name:  (null)
number of ops:  45
compiled vars:  !0 = $s, !1 = $a, !2 = $b, !3 = $temp, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'client_id%0Aaddress%0Aaddress_2%0Acity%0Astreet%0Aphone%0Aphone_2%0Amobile%0Amobile_2%0Aemail_2%0Aweb_address%0Aweb_address_2%0Asex_id%0Asex_orientation_id%0Adate_of_birth%0Aancestry_id%0Acountry_id%0Aheight%0APRIMARY%0Aweight%0Afigure_id%0Abreast_size_id%0Aeye_color_id%0Ahair_color_id%0Ahas_tattoo%0Ahas_piercings%0Abody_hair_id%0Aintimate_id%0Ais_smoker%0Ais_alcoholic%0Acanton_id%0Azip_code%0Alocal_id%0Afirst_name%0Alast_name%0Atext%0Anickname'
   40     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   41     6        ASSIGN                                                   !2, <array>
   42     7      > FE_RESET_R                                       $9      !1, ->42
          8    > > FE_FETCH_R                                       ~10     $9, !3, ->42
          9    >   ASSIGN                                                   !4, ~10
   43    10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !3
         12        SEND_VAL                                                 'id'
         13        DO_ICALL                                         $12     
         14        TYPE_CHECK                                  1018          $12
         15      > JMPZ                                                     ~13, ->29
   44    16    >   INIT_ARRAY                                       ~15     'int', 'valid'
         17        INIT_FCALL                                               'ucfirst'
         18        INIT_FCALL                                               'str_replace'
         19        SEND_VAL                                                 '_'
         20        SEND_VAL                                                 '+'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $16     
         23        SEND_VAR                                                 $16
         24        DO_ICALL                                         $17     
         25        ADD_ARRAY_ELEMENT                                ~15     $17, 'label'
         26        ASSIGN_DIM                                               !2, !3
         27        OP_DATA                                                  ~15
         28      > JMP                                                      ->41
   46    29    >   INIT_ARRAY                                       ~19     'min%281%29', 'valid'
         30        INIT_FCALL                                               'ucfirst'
         31        INIT_FCALL                                               'str_replace'
         32        SEND_VAL                                                 '_'
         33        SEND_VAL                                                 '+'
         34        SEND_VAR                                                 !3
         35        DO_ICALL                                         $20     
         36        SEND_VAR                                                 $20
         37        DO_ICALL                                         $21     
         38        ADD_ARRAY_ELEMENT                                ~19     $21, 'label'
         39        ASSIGN_DIM                                               !2, !3
         40        OP_DATA                                                  ~19
   42    41    > > JMP                                                      ->8
         42    >   FE_FREE                                                  $9
   49    43        ECHO                                                     !1
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.32 ms | 1400 KiB | 21 Q