xref: /PHP-7.4/ext/ftp/tests/ftp_get_option.phpt (revision 5153413e)
1--TEST--
2Testing ftp_get_option basic functionality
3--CREDITS--
4Gabriel Caruso (carusogabriel34@gmail.com)
5--SKIPIF--
6<?php require 'skipif.inc'; ?>
7--FILE--
8<?php
9require 'server.inc';
10define('FOO_BAR', 10);
11
12$ftp = ftp_connect('127.0.0.1', $port);
13ftp_login($ftp, 'user', 'pass');
14$ftp or die("Couldn't connect to the server");
15
16var_dump(ftp_get_option($ftp, FTP_TIMEOUT_SEC));
17var_dump(ftp_get_option($ftp, FTP_AUTOSEEK));
18var_dump(ftp_get_option($ftp, FTP_USEPASVADDRESS));
19var_dump(ftp_get_option($ftp, FOO_BAR));
20?>
21--EXPECTF--
22int(%d)
23bool(true)
24bool(true)
25
26Warning: ftp_get_option(): Unknown option '10' in %s on line %d
27bool(false)
28