3v4l.org

run code in 300+ PHP versions simultaneously
<?php $formerrors = array(); $formdata = array( 'first_name' => 'Tester', 'last_name' => 'Dev', 'company' => 'BobCAD', 'email' => 'no-reply@bobcad.com', 'phone' => '555-555-5555', 'country' => 'US', 'state' => 'FL', 'is_customer' => 'Yes', 'is_sw_customer' => 'No' ); foreach ($formdata as $key => &$value) { if (!empty($_POST[$key])) { $value = $_POST[$key]; } } unset($key, $value); echo "org".PHP_EOL; print_r($formdata).PHP_EOL.PHP_EOL; // Check Phone if (preg_match('/\d+/', str_replace(array('-', '(', ')', '.', ' '), '', $formdata['phone']))) { $formerrors[] = 'Please enter a valid phone number'; $formdata['phone'] = ''; } // Check Email if (preg_match('/\A[a-z0-1\-\._]+@[a-z0-1\-\.]+\Z/i', $formdata['email'])) { $formerrors[] = 'Please enter a valid email'; $formdata['email'] = ''; } // Check first_name if(empty($formdata['first_name'])) { $formerrors[] = 'Please enter a first name'; $formdata['first_name'] = ''; } // Check last_name if(empty($formdata['last_name'])) { $formerrors[] = 'Please enter a last name'; $formdata['last_name'] = ''; } // Check company if(empty($formdata['company'])) { $formerrors[] = 'Please enter a company'; $formdata['company'] = ''; } // Check country if(empty($formdata['country'])) { $formerrors[] = 'Please enter a country'; $formdata['country'] = ''; } // Check state if(empty($formdata['state'])) { $formerrors[] = 'Please enter a state'; $formdata['state'] = ''; } echo "checked".PHP_EOL; print_r($formdata).PHP_EOL.PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 48
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 54
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 60
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 66
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 72
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 78
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 78
Branch analysis from position: 72
Branch analysis from position: 66
Branch analysis from position: 60
Branch analysis from position: 54
Branch analysis from position: 48
Branch analysis from position: 38
Branch analysis from position: 13
filename:       /in/uWscG
function name:  (null)
number of ops:  86
compiled vars:  !0 = $formerrors, !1 = $formdata, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_RW                                      $6      !1, ->13
          3    > > FE_FETCH_RW                                      ~7      $6, !2, ->13
          4    >   ASSIGN                                                   !3, ~7
   17     5        FETCH_IS                                         ~9      '_POST'
          6        ISSET_ISEMPTY_DIM_OBJ                         1  ~10     ~9, !3
          7        BOOL_NOT                                         ~11     ~10
          8      > JMPZ                                                     ~11, ->12
   18     9    >   FETCH_R                      global              ~12     '_POST'
         10        FETCH_DIM_R                                      ~13     ~12, !3
         11        ASSIGN                                                   !2, ~13
   16    12    > > JMP                                                      ->3
         13    >   FE_FREE                                                  $6
   21    14        UNSET_CV                                                 !3
         15        UNSET_CV                                                 !2
   23    16        ECHO                                                     'org%0A'
   24    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $15     
         20        CONCAT                                           ~16     $15, '%0A'
         21        CONCAT                                           ~17     ~16, '%0A'
         22        FREE                                                     ~17
   27    23        INIT_FCALL                                               'preg_match'
         24        SEND_VAL                                                 '%2F%5Cd%2B%2F'
         25        INIT_FCALL                                               'str_replace'
         26        SEND_VAL                                                 <array>
         27        SEND_VAL                                                 ''
         28        FETCH_DIM_R                                      ~18     !1, 'phone'
         29        SEND_VAL                                                 ~18
         30        DO_ICALL                                         $19     
         31        SEND_VAR                                                 $19
         32        DO_ICALL                                         $20     
         33      > JMPZ                                                     $20, ->38
   28    34    >   ASSIGN_DIM                                               !0
         35        OP_DATA                                                  'Please+enter+a+valid+phone+number'
   29    36        ASSIGN_DIM                                               !1, 'phone'
         37        OP_DATA                                                  ''
   33    38    >   INIT_FCALL                                               'preg_match'
         39        SEND_VAL                                                 '%2F%5CA%5Ba-z0-1%5C-%5C._%5D%2B%40%5Ba-z0-1%5C-%5C.%5D%2B%5CZ%2Fi'
         40        FETCH_DIM_R                                      ~23     !1, 'email'
         41        SEND_VAL                                                 ~23
         42        DO_ICALL                                         $24     
         43      > JMPZ                                                     $24, ->48
   34    44    >   ASSIGN_DIM                                               !0
         45        OP_DATA                                                  'Please+enter+a+valid+email'
   35    46        ASSIGN_DIM                                               !1, 'email'
         47        OP_DATA                                                  ''
   39    48    >   ISSET_ISEMPTY_DIM_OBJ                         1          !1, 'first_name'
         49      > JMPZ                                                     ~27, ->54
   40    50    >   ASSIGN_DIM                                               !0
         51        OP_DATA                                                  'Please+enter+a+first+name'
   41    52        ASSIGN_DIM                                               !1, 'first_name'
         53        OP_DATA                                                  ''
   45    54    >   ISSET_ISEMPTY_DIM_OBJ                         1          !1, 'last_name'
         55      > JMPZ                                                     ~30, ->60
   46    56    >   ASSIGN_DIM                                               !0
         57        OP_DATA                                                  'Please+enter+a+last+name'
   47    58        ASSIGN_DIM                                               !1, 'last_name'
         59        OP_DATA                                                  ''
   51    60    >   ISSET_ISEMPTY_DIM_OBJ                         1          !1, 'company'
         61      > JMPZ                                                     ~33, ->66
   52    62    >   ASSIGN_DIM                                               !0
         63        OP_DATA                                                  'Please+enter+a+company'
   53    64        ASSIGN_DIM                                               !1, 'company'
         65        OP_DATA                                                  ''
   57    66    >   ISSET_ISEMPTY_DIM_OBJ                         1          !1, 'country'
         67      > JMPZ                                                     ~36, ->72
   58    68    >   ASSIGN_DIM                                               !0
         69        OP_DATA                                                  'Please+enter+a+country'
   59    70        ASSIGN_DIM                                               !1, 'country'
         71        OP_DATA                                                  ''
   63    72    >   ISSET_ISEMPTY_DIM_OBJ                         1          !1, 'state'
         73      > JMPZ                                                     ~39, ->78
   64    74    >   ASSIGN_DIM                                               !0
         75        OP_DATA                                                  'Please+enter+a+state'
   65    76        ASSIGN_DIM                                               !1, 'state'
         77        OP_DATA                                                  ''
   68    78    >   ECHO                                                     'checked%0A'
   69    79        INIT_FCALL                                               'print_r'
         80        SEND_VAR                                                 !1
         81        DO_ICALL                                         $42     
         82        CONCAT                                           ~43     $42, '%0A'
         83        CONCAT                                           ~44     ~43, '%0A'
         84        FREE                                                     ~44
         85      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.24 ms | 1404 KiB | 19 Q