Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104366 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21253 invoked from network); 12 Feb 2019 19:16:00 -0000 Received: from unknown (HELO mail-lf1-f50.google.com) (209.85.167.50) by pb1.pair.com with SMTP; 12 Feb 2019 19:16:00 -0000 Received: by mail-lf1-f50.google.com with SMTP id q12so2428153lfm.0 for ; Tue, 12 Feb 2019 07:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V+P349AXkTeFD4R7gBiIvL/2YTNGUxXlgm1DC7GTRjw=; b=wcPTpYKcvAjv1JyY/QjDxr3rnqBvB1cbbXymVFov1L2Zd8G/3LhAXRJ5DcN3eRfU93 CG8NXwosYRINFjFztEEBAwemChN6F/s513QGtm7ID5IFl4UT3ofolkGNPGiRcZnxpdiR fgT4L86h/Yt0+a4mM/fMvJnW4WISFRojWWTn5il++scApXLUbAz7o7Kvs7l+Z+o0wnWY wvn9XIWOky/qrWTQbgfC+XMnW/e4HrVnvmJM1TMGXbWCu0ivgS73BeaQ1DpQBHFCnx5r 81DjQAEVG8MrAIrW+eGaGU+79a9iIXLn9oul8WbKy822EJj9wu5E9TjYRyAHeL7242A6 8ZpQ== 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=V+P349AXkTeFD4R7gBiIvL/2YTNGUxXlgm1DC7GTRjw=; b=AC4SFX/mTDcxMHiUt09pWaM4bqAkT/Sv34RdInpey7T3PvHhEaw1nAvleogQt8weGM haows3jXF9Jq1R5eT6JfpHZg3/5K5S+hJIL/7HMeDreTT7+7R2KrD7y932+9ZoZePRFa 3KZfQT8CsraZqm0/v66C83yKxQ0SMtVsNpyjzu/9RgUJI/AVRo7792EzMDhcFgLPvxcv 0um25HW39Him9k8BkOZjXPNO99jppIgJ1qtbAXKHxIHY3TBnI+BVSMfDtONS3YfvtHAa vFDHjSxoaPAu7e+6kE3jISkbK9FF+Hig7h7bX3RpvrjNoT4ZlLHnVpAJ09VE8n2mWTtk mwsg== X-Gm-Message-State: AHQUAuaDw63xZzKk7naJblCUuo5nqkujV1XM5sdhPV1O5F9jVNodTPRt El8V0anIlBeM6t/x4IrdWjrIim0AT036erEQyTJ96A== X-Google-Smtp-Source: AHgI3IZUCERpEc1W35b1MlcDmn1v/lYxPplYN0jnnx0zeaG5Se09YbFzNz0eJCXzPAqG/cjMCPKOpN5WK4bMcwgOCtM= X-Received: by 2002:ac2:4154:: with SMTP id c20mr3062495lfi.108.1549987134557; Tue, 12 Feb 2019 07:58:54 -0800 (PST) MIME-Version: 1.0 References: <1549987000.2902.28.camel@schlueters.de> In-Reply-To: <1549987000.2902.28.camel@schlueters.de> Date: Tue, 12 Feb 2019 16:58:43 +0100 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Nikita Popov , PHP internals , bishop@php.net Content-Type: multipart/alternative; boundary="0000000000009011360581b480b7" Subject: Re: [PHP-DEV] Convert ext/xml to use an object instead of resource From: kontakt@beberlei.de (Benjamin Eberlei) --0000000000009011360581b480b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Johannes Schl=C3=BCter schrieb am Di. 12. Feb. 201= 9 um 16:57: > On Di, 2019-02-12 at 10:29 -0500, Bishop Bettini wrote: > > Would it make sense to update is_resource > > (and friends) to be aware that "resources" returned from xml_parser_* > > are not resources proper, but rather resources nominal? > > > > If userland needed to strictly determine what was a resource proper > > and what was a resource nominal, we could improve the signature: > > is_resource(mixed $var, bool $strict =3D false). But, honestly, the > > aforementioned opaqueness makes me think this wouldn't be necessary. > > How do you distinguish an object with a "resource" from one not > representing such a thing? > > - Any object? > - All internal ones? > - Add a class_entry flag? > - Hardcode a list? Extend an interface maybe > > > None of those really make sense to me. > > The `is_*` routines look at PHP's type system, the information for > general use is limited (we don't have ReflectionResource as well ... > while that couldn't do much anyways as a resource is only a void*) > > The only use case here seems to be > > $foo =3D xml_*(); > if (!s_resource($foo)) error(); > > Which is limited, since the only xml function returning a resource > seems to be xml_parser_create() which will always succeed (except out > of memory or similar) > > johannes > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0000000000009011360581b480b7--