Bug #67923 [Opn->Nab]: json_decode doesn't give error when decoding IP address

From: Date: Wed, 17 Dec 2014 17:31:00 +0000
Subject: Bug #67923 [Opn->Nab]: json_decode doesn't give error when decoding IP address
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189098@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67923&edit=1 ID: 67923 Updated by: nikic@php.net Reported by: sorin dot badea91 at gmail dot com Summary: json_decode doesn't give error when decoding IP address -Status: Open +Status: Not a bug Type: Bug Package: JSON related Operating System: Elementary OS 0.2.1 PHP Version: 5.5.16 Block user comment: N Private report: N New Comment: Working fine: http://3v4l.org/dkcl5 You're likely using jsonc instead of json. Previous Comments: ------------------------------------------------------------------------ [2014-08-28 11:08:07] sorin dot badea91 at gmail dot com Description: ------------ php -v PHP 5.5.16-1+deb.sury.org~precise+1 (cli) (built: Aug 25 2014 10:23:41) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with XCache v4.0.0-dev, Copyright (c) 2005-2013, by mOo with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies with XCache Optimizer v4.0.0-dev, Copyright (c) 2005-2013, by mOo with XCache Cacher v4.0.0-dev, Copyright (c) 2005-2013, by mOo with XCache Coverager v4.0.0-dev, Copyright (c) 2005-2013, by mOo Test script: --------------- <?php var_dump(json_decode("192.168.1.1")); //=>float(192.168) var_dump(json_last_error());//=>int(0) Expected result: ---------------- An error ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67923&edit=1

« previous php.bugs (#189098) next »