Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105490 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 95521 invoked from network); 29 Apr 2019 04:41:52 -0000 Received: from unknown (HELO mail-qt1-f180.google.com) (209.85.160.180) by pb1.pair.com with SMTP; 29 Apr 2019 04:41:52 -0000 Received: by mail-qt1-f180.google.com with SMTP id f25so10261350qtc.8 for ; Sun, 28 Apr 2019 18:43:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rVaENgZS9vBoRJt6SoLzmmE6BTysF3xoibiUSHHdWEI=; b=rmwPOInMX/G5RX/QDWzypAeadg8eVgHqg87qB+PitxIZxI7D6COapm8okd67UXpXJK EddxGAvVoDX5G7RHg8oeEGDJIZkLZAbvH+FF8G2tHYabCTKf5knRA2Yc198OA90rF+0M TKuET/xgtt7vXwPGKdEwOOGip295sD74lEWplwxZjk9cqfHwjjQyZqzHTgNd5vtHRlrI yfy+4S6a/uqIEK0Ctpu5jsfNqEV38s7fYKhi2Ac7cdYaW8cI40AmhnwFq9uxFvgjbjMi fx1b9cdM2MumLGfmJ8iotejw8yaYnPXEZbkx4/JY/X4Paj4SkJqdDLi48OK3o7JWpw86 mzjw== X-Gm-Message-State: APjAAAU7j0hUiCEon/2A+9z0BeZvsifIVugGjcNPcuPszUs2utjjgg3S 2Cl8XFOLOXSH3d4JeTno7mqe1bZzkg67l0rBg8YkKg== X-Google-Smtp-Source: APXvYqy1RsMUyAlM73GRjLSk1sGgrX+rtx9SwOHjMv97DkdHIee648Axvw/38/xOD48svzG9KC5XiSTL3N7oZe6tiaU= X-Received: by 2002:ac8:2c12:: with SMTP id d18mr12846919qta.219.1556502219218; Sun, 28 Apr 2019 18:43:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 28 Apr 2019 20:43:28 -0500 Message-ID: To: Gabriel Caruso Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000de74200587a169bc" Subject: Re: [PHP-DEV] Don't silence chr function arguments error From: pollita@php.net (Sara Golemon) --000000000000de74200587a169bc Content-Type: text/plain; charset="UTF-8" On Sun, Apr 28, 2019 at 6:05 PM Gabriel Caruso wrote: > Currently, if you pass an argument that is not an integer, it will simply > return an empty string: https://3v4l.org/FF2nA. Not entirely accurate. It outputs a one-character string (the null byte). > In case you pass more than > 1 argument, it will complain about "Wrong number of arguments": > https://3v4l.org/Yrr43. > > > The proposal of https://github.com/php/php-src/pull/4080 is to relly these > checks to ZPP, making the first argument mandatory to an integer, and make > the error message for extra arguments consistent with the rest of the core > functions, e.g. "Warning: chr() expects parameter 1 to be int, string > given". > > I'm actually perfectly in favor of raising a proper warning here. I noticed the odd behavior when I was porting this function to HHVM and IIRC I raised a discussion about it and the bottom line was "Let's not do this because X", and I couldn't possibly tell you what X was. :( The thread is out there somewhere though. > The idea is to merge in PHP-7.4, but if there's a consensus that this > should go into PHP 8 only, so it is :) > > Technically a BC break, so 8.0 would be the preferred branch IMO. -Sara --000000000000de74200587a169bc--