Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103732 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55756 invoked from network); 14 Jan 2019 18:22:41 -0000 Received: from unknown (HELO mail-it1-f170.google.com) (209.85.166.170) by pb1.pair.com with SMTP; 14 Jan 2019 18:22:41 -0000 Received: by mail-it1-f170.google.com with SMTP id p197so12514730itp.0 for ; Mon, 14 Jan 2019 06:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BhWPG7HmCjhuQjh4C+bHW4x4EMM29A0Fxb0DYQ/VECc=; b=d0uNstKxg5xqMMjwCDM3KLYooJ25wJL58+DiZprHIIVLSskLzbBrLiaizgsUml0iiv eJsUOVppzdaslEj6LLSp6LCCJWjCkG+xP5KMpfXPB7BPtFwKgk8abIEsNueT1UkJBxyR GBBknkTb7LqQPwjqILE3xM6a1+/fmfQ006cWV9XgGuH5oHR2FENACfZD2jepu1YgCKrh 7ggoVHC5FFn+DM3FP6b7QNDtmPJU+rx6hYPOq2E5oeK8sgKstw+8Y7vHrn4wjDCxZoUb 7jH9+iQz/t9OK5Nj0Yt1bQkDjdJ0NoXvdTtrL0CKiFX0bjhPLu9eYE9FZ3hlS941uvGQ kvDA== 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=BhWPG7HmCjhuQjh4C+bHW4x4EMM29A0Fxb0DYQ/VECc=; b=ZBwRhHl5uJN2H/8iYaFobNwBhy/cUo3IuFpzd9HOs0VZ/k46e6OlX5ZkWxsmy5RI4R 6aXlBLVhuxqCr1E45xNb3sl7rrfv/8ngDMuKjBgAVULrwBR5nFSl7iLqH41UuUYoZkX0 xJ2IneKnN6s8GcroWmyfUuxb1WFg/48Io3XZsjoiVLz0ywaKo9VzQaHusinn1UbaYZFa lLAjkV4xMiC4Z5szWYMsowmerSZKjrBqg5cwhVK72e9B6W+KMZKP+AxMZpEI5hFcFxFh HVT42DJvFzKq0M5RO2OX91jx14njWoX/4vEXH7OB+WTQBnpXoLdZUnP65++8RWW+tmvQ LzRQ== X-Gm-Message-State: AJcUukdcZHGgH2vLIQiFr0YUd907uAaFArBwHB3Dxr6980GVjqfVhXex CSXOdV8FTND/oMQ04SNfP2/Ebf8W8kneOrtrxaw= X-Google-Smtp-Source: ALg8bN4qGXwAUPkd+2eelFS/e1Mh+V1SUkI0LgPF9bwtNNAYjUt2iUbsBk3jAjsjJxgXziYP7ci+Bj0msM9uPHGcZnk= X-Received: by 2002:a24:d4c2:: with SMTP id x185mr8480433itg.34.1547477900552; Mon, 14 Jan 2019 06:58:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Jan 2019 14:58:09 +0000 Message-ID: To: Nikita Popov Cc: Craig Duncan , Internals Content-Type: multipart/alternative; boundary="0000000000008f6f9c057f6c46d0" Subject: Re: [PHP-DEV] Making stdClass iterable From: rowan.collins@gmail.com (Rowan Collins) --0000000000008f6f9c057f6c46d0 Content-Type: text/plain; charset="UTF-8" On Mon, 14 Jan 2019 at 14:48, Rowan Collins wrote: > Currently, it has no methods, and matches no type checks other than itself > and "object"; in a sense, it doesn't even have any properties, just the > ability to add them dynamically. To me, that makes sense: it's the > "classless object", the absolute bare minimum any object could be. > Apologies for the multiple replies, but it just occurred to me that with anonymous classes, we can define something even more minimal: $foo = new class {}; $bar = new stdClass; Given that stdClass is returned as a "default structureless object" by a lot of internal functions, what is the justification for $foo and $bar here behaving differently? Regards, -- Rowan Collins [IMSoP] --0000000000008f6f9c057f6c46d0--