Display the drop-down list

Test of addcslashes()

Example #1 : test success
Example #2 : test success
Example #1
$input = [
  
=> 'foo[ ]',
  
=> 'A..z',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '\\f\\o\\o\\[ \\]',
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> 'zoo[\'.\']',
  
=> 'z..A',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'string' => '\\zoo[\'\\.\']',
  ],
  
'errors' => [
    
=> [
      
'code' => 2,
      
'message' => 'addcslashes(): Invalid \'..\'-range, \'..\'-range needs to be incrementing',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]