Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118053 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31123 invoked from network); 22 Jun 2022 13:14:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2022 13:14:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 05894180552 for ; Wed, 22 Jun 2022 08:04:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_20, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 Jun 2022 08:04:30 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id f39so12640995lfv.3 for ; Wed, 22 Jun 2022 08:04:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B7FEfM3hLWkgIRjlgTXa5gny5DvwHGke9EiwhHHlwBk=; b=bFQ7HoCDQ6Pr8oTML7MRoja/wHSvRQQCRTuzoKsEEZyyABP0KEgmnx9Rf+HvdjCbeM L0DTM8U/G7tn8Tvf3jH6oL5foH7PVvkCheGcju852Eooo7j/wrZKOvr5sJDsyFUSaOQD +YUnD/8tIlEt2iy82+Zw66K9eormpHI68seFp1V1vimn/Wf495YKqGWNl7eKmqlneGzp tMlt5N5KortxsuxNLyCuVijygWyYSmCmhsipI8jmVdUHh6+D9FI4qeUX20ZEieg3rcId yS1LH1aTBOgczIyY0EC3fa7/W7iSGyBcpiHVKbttcr+2dAmXeDKZmwULOpuiPVV7iNzQ UuTg== X-Gm-Message-State: AJIora+jh/sF5QHRBfValQ2IRDJ8rOQm/TF1/0RvmW3jZQixmW96NdCN AdB7lHnDvBkHw68uz3CncQ2dSCyeHdoQUn3YAiCiRA== X-Google-Smtp-Source: AGRyM1uxOjYWGxreNUUsmHwHBloENn37JL0zalRgV9p6O6RbmWWQ++Eg9u3YQQM6X56ZA8P8MC46p2hxjchGlLf/O0A= X-Received: by 2002:a05:6512:3e09:b0:478:f180:2264 with SMTP id i9-20020a0565123e0900b00478f1802264mr2434639lfv.448.1655910268998; Wed, 22 Jun 2022 08:04:28 -0700 (PDT) MIME-Version: 1.0 References: <7CB0EB0B-700D-49F6-8223-00A9B16F463B@php.net> In-Reply-To: Date: Wed, 22 Jun 2022 11:04:17 -0400 Message-ID: To: Hans Henrik Bergan Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000005d290605e20aa792" Subject: Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API From: pierrick@php.net (Pierrick Charron) --0000000000005d290605e20aa792 Content-Type: text/plain; charset="UTF-8" HI Hans, any particular reason CurlUrl::getPort() defaults to 0 rather than one of > the valid options? (that being CurlUrl::DEFAULT_PORT > and CurlUrl::NO_DEFAULT_PORT ) > This is because the default is none of those 2 behaviours, If the port wasn't set it will return null, but if the port is the default port for the scheme it will still return it. makes it sound like these would return null: http://localhost:80/ > https://localhost:443/ ftps://localhost:22/ > > Is that correct? I would imagine it returns null if the port isn't > specified, rather than null if the port when specified matches the default > port? > > That's correct, if you use CurlUrl::NO_DEFAULT_PORT. The behaviour you were expecting is the default one ($flags = 0) --0000000000005d290605e20aa792--