Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16989

Re: Rant: http_build_query() and arg_separator.output

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.php
Subject Re: Rant: http_build_query() and arg_separator.output
Date 2016-08-29 14:53 +0200
Organization solani.org
Message-ID <nq1b7e$flr$1@solani.org> (permalink)
References <71e67ba6-2bd8-bc0f-3276-b8dbfd6b75c9@arnowelzel.de> <npp38v$8vj$1@solani.org> <9a112104-5a9b-46dc-080e-5121d01697ee@arnowelzel.de>

Show all headers | View raw


On 29.08.2016 at 07:43, Arno Welzel wrote:

> "Depends on a PHP_INI_ALL ini setting" is what I call "unpredictable". A
> function should have a defined default behaviour which is not depending
> on some global setting. You never know what will come out unless you
> also check the runtime configuration or use a parameter which was not
> there before PHP 5.1.2.

Well, even a simple string conversion of a float depends on several
runtime configuration settings:

  $number = 1/3;
  echo $number; // => 0.33333333333333
  setlocale(LC_NUMERIC, 'de_DE.UTF-8');
  echo $number; // => 0,33333333333333
  ini_set('precision', 2);
  echo $number; // => 0,33

Whether you like it or not, that's PHP, and the behavior is unlikely to
change in the (near) future.

> But why is the argument separator for URLs a configurable runtime
> option? It makes no sense at all.

That *might* be caused because somebody liked to have it to be `&amp;`
instead of `&`.  IMO, a bad idea, but that's how it is.

-- 
Christoph M. Becker

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Rant: http_build_query() and arg_separator.output Arno Welzel <usenet@arnowelzel.de> - 2016-08-26 09:05 +0200
  Re: Rant: http_build_query() and arg_separator.output "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-08-26 11:48 +0200
    Re: Rant: http_build_query() and arg_separator.output Arno Welzel <usenet@arnowelzel.de> - 2016-08-29 07:43 +0200
      Re: Rant: http_build_query() and arg_separator.output Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-29 13:16 +0100
        Re: Rant: http_build_query() and arg_separator.output Arno Welzel <usenet@arnowelzel.de> - 2016-08-30 08:39 +0200
          Re: Rant: http_build_query() and arg_separator.output Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-30 15:10 +0100
            Re: Rant: http_build_query() and arg_separator.output Arno Welzel <usenet@arnowelzel.de> - 2016-09-01 08:43 +0200
              Re: Rant: http_build_query() and arg_separator.output Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-07 22:18 +0200
      Re: Rant: http_build_query() and arg_separator.output "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-08-29 14:53 +0200
        Re: Rant: http_build_query() and arg_separator.output Arno Welzel <usenet@arnowelzel.de> - 2016-09-01 08:53 +0200

csiph-web