Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106172 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35517 invoked from network); 8 Jul 2019 16:34:25 -0000 Received: from unknown (HELO mail-ed1-f48.google.com) (209.85.208.48) by pb1.pair.com with SMTP; 8 Jul 2019 16:34:25 -0000 Received: by mail-ed1-f48.google.com with SMTP id k8so14609179edr.11 for ; Mon, 08 Jul 2019 06:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=AShXTfbYikdUFPMq8ynF1Emc+AJWeixxJaoGXjWAEwY=; b=tGD8VW2BTP67ehEXlJkAYCTBj8gITVMdz/9juoZM1my1g+oOtq7V8qL0n7g/WvWZrE IYxMSndKcC1WAGftLl8n0+Zxq3nxv89EWLIAUjmlbHktntQrofSxnW6J2apovunh8MSR M6Ic34pCAWL71nDu69vOK2kRncPz0ObQOYLAhQmK2t5HGZpj06qrV+bkqCBOFxxGfnsN mo6CFLvapOWhxv1zYC5CS3/vcjLQ+TWcNDW9usUJI24xLfGclqPYaOcc9Es6CdgkMGaL Yb3bdbUTE7cy+GmRGDKp8Xu1un7ugkjTsQTc/QushIFEG1Nc6q1e7GrDR2uyVzDd1Rax Zcdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=AShXTfbYikdUFPMq8ynF1Emc+AJWeixxJaoGXjWAEwY=; b=a4Y9ZE+stmDjjbyAGJ2DqLqC8ou/1lAXKVBi/Ct8yaEWHhEVhcHebKfNxmd45e0/W7 hu4OsPvFu9u3+DouaYeMcBnUUEoOB/ulrsMbGeLB5uV0Q8kNhiVEHNZ6YcGNV8NM3IbM YekhudvfXoAFly4bXXYnn9uUJr0910TOoky49FnG6yBjI629hAxcpwJpMVKgawZ/x9K1 eVOBmNKS/18LhmFR2vIo1Q1ySBGOiKvKWS4eeT3ZSBPe4FVf58JAKdTpyQuYNJ9xRI0x SOhDf5bLSmWl25M9x9PVjXh9dkCom4ILRbLR/pyCb7HDXeIgIyiGz3qQADO8BRJ9XZ3g gb/Q== X-Gm-Message-State: APjAAAUVDP9wXkUwAjwW6k3Wxr2lTmA2CrMm4tkuAwJXgglBQGiq1pWn wOJzBu4qdHT1Gy+ND70iWqQ= X-Google-Smtp-Source: APXvYqz9Zgy3tuAGLTjJ/E7e0vkfd+w94tiobygu4bNy006Mnhs5AFEI/vqACLP1p6C+bVVhd29rOQ== X-Received: by 2002:a17:906:6c85:: with SMTP id s5mr12464864ejr.199.1562594029408; Mon, 08 Jul 2019 06:53:49 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id f3sm3443401ejc.15.2019.07.08.06.53.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2019 06:53:48 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_72A781B0-2F30-4E66-8CB3-14A518EB3560" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Mon, 8 Jul 2019 15:53:47 +0200 In-Reply-To: <7ff385f1-b86d-e56d-4133-e2f101afa13e@gmx.de> Cc: Andrew Gromov , internals , ocramius@gmail.com To: "Christoph M. Becker" References: <1562591120.659818.23020.47476@mail.rambler.ru> <7ff385f1-b86d-e56d-4133-e2f101afa13e@gmx.de> X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] Re: [VOTE] Voting opens for str_starts_with and ends_with functions From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_72A781B0-2F30-4E66-8CB3-14A518EB3560 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 8 juil. 2019 =C3=A0 15:20, Christoph M. Becker = a =C3=A9crit : >=20 > FTR, there is already substr_compare(). `substr_compare()` (as well as `strncmp()` which I am currently using in = lieu of `str_starts_with()`) forces you to provides the substring and = the length of the substring, instead of just the substring: substr_compare('foobarbaz', 'foo', 0, 3) =3D=3D=3D 0 strncmp('foobarbaz', 'foo', 3) =3D=3D=3D 0 str_starts_with('foobarbaz', 'foo') =E2=80=94Claude= --Apple-Mail=_72A781B0-2F30-4E66-8CB3-14A518EB3560--