Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87938 invoked from network); 2 Dec 2013 16:07:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2013 16:07:44 -0000 Authentication-Results: pb1.pair.com header.from=matthewfonda@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=matthewfonda@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.180 as permitted sender) X-PHP-List-Original-Sender: matthewfonda@gmail.com X-Host-Fingerprint: 209.85.223.180 mail-ie0-f180.google.com Received: from [209.85.223.180] ([209.85.223.180:55868] helo=mail-ie0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/91-11395-F40BC925 for ; Mon, 02 Dec 2013 11:07:43 -0500 Received: by mail-ie0-f180.google.com with SMTP id tp5so21174376ieb.11 for ; Mon, 02 Dec 2013 08:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=dcUrSlLUg9lolbsFUOFx2Vw4vjMti2hSTe7+xf9UI0c=; b=dRFEUg3HQlp7aiMGSUBS7GS2xT9IMMhCWsPjoWBumvEQzwvpEKzktvg54p0aglCO2q 6i8/qCWoEOSOhTMemDjDu6Hd/XnnMBdsgro7uDS7jVAB/z+YyL3/Z+GE6LH8qpwl68PW 9Crr9vGvCtBob80IFLN5AOtQhgZANBK9IPZS0U2a75f+gYDdiA2m1ocHXXErouc1KXwC KsUivt7/AZ5afIIYf5zNj1ILO/TjC96VCp+i5Tr47grDtGLeCyay7qhLK/9P4Ntt5RkI /6YPOGLEBET4CMwgtvdp+NfkNAH6bTDanvtdRkseGsNA83WI1OPQviy1Efum6tDPaIHw kCiA== X-Received: by 10.50.225.39 with SMTP id rh7mr18660047igc.10.1386000461002; Mon, 02 Dec 2013 08:07:41 -0800 (PST) MIME-Version: 1.0 Sender: matthewfonda@gmail.com Received: by 10.50.61.99 with HTTP; Mon, 2 Dec 2013 08:07:10 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Dec 2013 08:07:10 -0800 X-Google-Sender-Auth: j799-7frnW0iCUIpHOvkvxyU-fA Message-ID: To: =?UTF-8?Q?Mat=C4=ABss_Roberts_Treinis?= Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c3a8cc23105504ec8f615c Subject: Re: [PHP-DEV] Regarding object casting From: mfonda@php.net (Matthew Fonda) --001a11c3a8cc23105504ec8f615c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Mat=C4=ABss, Internal classes are able to define what happens when casting to different primitive types. There was an RFC [1] to extend this behavior to userland, but it has since been withdrawn. See archives for further discussion about this. Best regards, --Matthew On Mon, Dec 2, 2013 at 4:19 AM, Mat=C4=ABss Roberts Treinis wrote: > Good day, PHP internals folks. > > As we all know, objects in PHP casts to true by default, except one > particular class - SimpleXML objects created from empty tag. > > Many people in the community has had a problem with this limitation (or > lack of functionality) to be able to set cast value of the object and are > exploiting the SimpleXML to achieve the ability to control object casting= . > > The question would be, why this exception - SimpleXML? Could we have a > magic method or other way to control how object is being casted? > > Thoughts? > > Thanks. > --001a11c3a8cc23105504ec8f615c--