Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108392 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 34963 invoked from network); 4 Feb 2020 17:07:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Feb 2020 17:07:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 13526180531 for ; Tue, 4 Feb 2020 07:19:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 4 Feb 2020 07:19:15 -0800 (PST) Received: by mail-io1-f51.google.com with SMTP id z8so21343202ioh.0 for ; Tue, 04 Feb 2020 07:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RMlU8sKS4H7HpOHRiB/KshhDGfNOjXdGUoKw/j5xA6c=; b=KviGMORYibEvnCaU/kPvTiQmtYHdAKa6WUyygLmaV8lOrde/6hALwARwG2klenS889 oNCWwxUm+s0KP0Nw1ki9Hnh2mGT2V6fmIjh/eTFYeaCJ6W5ZCjFJqsSVM9ROijxoAPVb 3IrXaezd56x77uaAnU2uAwwZten5kd27RM7+8= 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=RMlU8sKS4H7HpOHRiB/KshhDGfNOjXdGUoKw/j5xA6c=; b=NJroNNm1dLx9Y5OR1nBjZVLXQoSHocP8sTOT/oeFsUsX8hteobzbm8NprvR/azsKFn NTGV18ix5hnMASZITYJm+GtW1BeH0tk4hTs6KXjP1IXFoYphp+w479ArjyaFkLpl9FWl ZpgQLT4DwsrIAvU6ur9w4rjk0SJfe/HqI4EsjckdKoPkKCGz1rz8eOxl7/3aG3yRES7D Nfnpy4DXTnM339uyrJLEbrZomd7mzLJHhnqgQItE8tSiNX+FabboqpfMwpJl9wrxvFYO mVfvvGxv5KyPvNatfv5n8ZplfzK4sNjgRxwCLL2rFYFetKCHRJFUTEQpRGnHz6pXsN3y Ny9A== X-Gm-Message-State: APjAAAWiP+UnYWMPafun41UVOl0i/DPmjq/YdcK3YWlJZGDf9J3prKVj NJTmXuQRQc2PALuglysy/bzS7NPAfqiWll8zf3CBfw== X-Google-Smtp-Source: APXvYqxznDqy+YUKrKwTcxj00N35o8k2x26Q+wl5u4VKH9z1ueTDbBX47ljqKi1POn5lyGQlJVrChqm1ki7fqUV/c7U= X-Received: by 2002:a5e:9246:: with SMTP id z6mr25115469iop.232.1580829554915; Tue, 04 Feb 2020 07:19:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Tue, 4 Feb 2020 08:19:03 -0700 Message-ID: To: Marco Pivetta Cc: Steven Wade , PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC - discussion] __toArray() From: internals@lists.php.net ("Levi Morrison via internals") Sorry if it's been said in the discussion so far, but I do not see why `print_r` should convert anything to an array. It accepts multiple kinds of types including strings, numbers, and so on, and I think adding this behavior to `print_r` is a different thing than wanting a standard way for objects to be converted into arrays. And on that note, what is the motivation for wanting a magic method for converting an object into an array? Why not make it an explicit operation? I do not see the point of the magic here, except _maybe_ for adding it to `ArrayObject` or something to allow it to work with the array_* functions that work without references, in which case I think we think this RFC is the wrong approach as it is inadequate for that purpose.