Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109938 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5948 invoked from network); 30 Apr 2020 00:11:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Apr 2020 00:11:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BBB051804C7 for ; Wed, 29 Apr 2020 15:45:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL 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-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 ; Wed, 29 Apr 2020 15:45:23 -0700 (PDT) Received: by mail-qk1-f180.google.com with SMTP id k81so1141327qke.5 for ; Wed, 29 Apr 2020 15:45:23 -0700 (PDT) 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=vHXAKOnPW5fDAusKWNH3U2xY/CxMOI/4vB7cTMkWqS0=; b=rToyjHmKwSCfacw113opnyoM9zQRMy/u3ys/oqElSeJwG1+gZnBqottHQniqHHrOvX efW5/5Fb1sY3/zYERKiOQ9Gv/Kq5SZ7r3PzAHf5B/Ei7iZ9sxza8py9A0SbOq9044AtS joPW6ID0cog95u8H3G4HRwsgfztHurtLIqSFSUNsRVx5YU+plgva9ZN8PUudc5zvPOmp ZX+TMLo96MQ2D30TuwqM2Uwj1Dp2DN1cudTNTBHN4sgPm/8RVg+bv2V8xGS5wmWSrjm0 C5PAEtj2s1+YwBhVWbESgNY4elEco0Us48foerghlk6bh9IPLHeEsWoi4O9qzv92Don7 pxlg== X-Gm-Message-State: AGi0Pua1pC5hwdKntHYx/P1C6Vk8T1ykodTY6vkLtRA6X15eP2sjCmhN vS4Lm4nn9TOVFb/uCmCVYh99G9ddbWytgwNnZg80/A== X-Google-Smtp-Source: APiQypInCnfjm94QI4H7DM+SFRrR9+51CfLFOsCmccSGuHXjZ/RD9skazC77e7jS2ZtICizvtk/4j5UWI3a8hDxK2sc= X-Received: by 2002:a05:620a:3c5:: with SMTP id r5mr795952qkm.440.1588200321698; Wed, 29 Apr 2020 15:45:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 29 Apr 2020 17:45:10 -0500 Message-ID: To: Benjamin Morel Cc: Nikita Popov , tyson andre , Internals Content-Type: multipart/alternative; boundary="00000000000001dfdb05a475b410" Subject: Re: [PHP-DEV] Moving json extension to core? From: pollita@php.net (Sara Golemon) --00000000000001dfdb05a475b410 Content-Type: text/plain; charset="UTF-8" On Wed, Apr 29, 2020 at 5:36 PM Benjamin Morel wrote: > I want my classes to implement JsonSerializable, but this means requiring >> ext-json and bumping the library version. >> > > At the risk of derailing... You can have your class implement the interface unconditionally, then have a polyfill definition in your autoload for cases where it doesn't exist. Obviously, it won't have an impact on calls to json_encode(), but if the interface doesn't exist it's because json_encode() doesn't either, so that should be harmless. :D -Sara --00000000000001dfdb05a475b410--