Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100079 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63528 invoked from network); 28 Jul 2017 11:51:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2017 11:51:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@duncanc.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@duncanc.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain duncanc.co.uk from 209.85.216.170 cause and error) X-PHP-List-Original-Sender: php@duncanc.co.uk X-Host-Fingerprint: 209.85.216.170 mail-qt0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:37922] helo=mail-qt0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/14-40376-0352B795 for ; Fri, 28 Jul 2017 07:51:12 -0400 Received: by mail-qt0-f170.google.com with SMTP id t37so81987847qtg.5 for ; Fri, 28 Jul 2017 04:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duncanc-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=N4pOCrUfM0XfCrgz6h058Sa8lw8glrzFmnKtg0c4iNw=; b=zZKLxl+7GNopcu+2dzKnY35EtzqjlEPh3+95m3rg7Vko3qFtngOp/gsb9528KwKf/C tI0Z0tJItVAfvzaevprsKhdjArjQ8TRfXdGOkDVXSwQXlyYz5x6xhgEmoqb7s3/lJKXH Ng4lHnsikP2uWkTvWB1BnEX2hDeY8qcEmAHru+S3hH8Nn/vTiyoWgp7q9CDbp3Aaz+h8 qeZU9Squxddd3Qx8RBAYEgscv52DXWUD6nWmpAdSgp2YJ6QfJ5J9sGcqZj+Ay89qOOR7 08V3iRXWIO79XYqrJqC168+3nHHt8bYL3iOTmUzhjnT0FFW28ONz2GzCiXsliix0mMSN t7ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=N4pOCrUfM0XfCrgz6h058Sa8lw8glrzFmnKtg0c4iNw=; b=Aj0Me3k2bFUZ0fCue0sDxFNhfyRzLW2YHApHlIJOBBRE0SPX0wawBcS1jBMVkYoeuS LXvG0VUWyvxjwjmb2sEBFhaEhweE6XNtpuOTvuU9ssnmKNFCByC0gJPJHSuoQjLaYe48 41t3oFQ7UhNV91lXV/fXuIZI9J5wIR/rvhfX2tVYhyQXRR4pFkRQvxon0Bd/gUYl2yR/ 4MLTJIUhVvERFBTQkd/THffbIAFFUyjFcWtB1oe3iaiIshwsNJzlUClMWwzgr3DHWn0A Du4LZiHc3Zd5pe/6W6sCls9u3vcaB7ud4PlkGMlwaNfjL9R8gy6BD8CAQ5pQ7RJDyVy8 uo6A== X-Gm-Message-State: AIVw110U/eIBHjr9xKlrBCPs/BY8REnbanCJxlkH1okxIKdqLgo0WykA hltaX7RATo4+QADRQVI= X-Received: by 10.237.33.204 with SMTP id m12mr10307229qtc.249.1501242669844; Fri, 28 Jul 2017 04:51:09 -0700 (PDT) Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com. [209.85.220.170]) by smtp.gmail.com with ESMTPSA id t43sm15739488qth.30.2017.07.28.04.51.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jul 2017 04:51:08 -0700 (PDT) Received: by mail-qk0-f170.google.com with SMTP id x191so50955852qka.5 for ; Fri, 28 Jul 2017 04:51:08 -0700 (PDT) X-Received: by 10.55.130.66 with SMTP id e63mr10178197qkd.253.1501242668249; Fri, 28 Jul 2017 04:51:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.25.163 with HTTP; Fri, 28 Jul 2017 04:51:07 -0700 (PDT) X-Originating-IP: [195.99.194.20] In-Reply-To: References: Date: Fri, 28 Jul 2017 12:51:07 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Andrey Andreev Cc: Internals Content-Type: multipart/alternative; boundary="94eb2c072b68f68a4e05555f4b25" Subject: Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues From: php@duncanc.co.uk (Craig Duncan) --94eb2c072b68f68a4e05555f4b25 Content-Type: text/plain; charset="UTF-8" On 28 July 2017 at 12:46, Andrey Andreev wrote: > > This is a long shot, but here's an idea: an OOP API throwing exceptions. > > Would require more work both to implement and use, but it would surely > be less error-prone and there'd be no BC break. > Hi Andrey, Yes that would resolve all BC issues, however that wouldn't help with new developers picking up the `json_*` functions and using them dangerously. As pointed out in the original thread, there are plenty of wrappers that provide this feature, the problem is that core functions have a huge gotcha. If we introduced a new API then we'd need to deprecate the `json_*` functions to make users aware, which I imagine would be the most contentious thing suggested thus far --94eb2c072b68f68a4e05555f4b25--