<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JSON | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/json/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Thu, 16 Apr 2026 14:19:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>PHP&#8217;s serialize_precision hidden danger</title>
		<link>https://nerdpress.org/2026/04/16/phps-serialize_precision-hidden-danger/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Thu, 16 Apr 2026 14:19:02 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[JSON]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=3477</guid>

					<description><![CDATA[<p>The PHP configuration directive serialize_precision can cause hard to debug issues. When deviated from its default value, it can lead to inexpected behavior in common functions like json_encode() and serialize(). The Problem If you change the serialize_precision setting from its default value of -1, the float precision will be more digits than 2 decimal places.If &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2026/04/16/phps-serialize_precision-hidden-danger/" class="more-link">Continue reading<span class="screen-reader-text"> "PHP&#8217;s serialize_precision hidden danger"</span></a></p>
The post <a href="https://nerdpress.org/2026/04/16/phps-serialize_precision-hidden-danger/">PHP’s serialize_precision hidden danger</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>The PHP configuration directive <code>serialize_precision</code> can cause hard to debug issues.</p>



<p>When deviated from its default value, it can lead to inexpected behavior in common functions like <code>json_encode()</code> and <code>serialize()</code>.</p>



<span id="more-3477"></span>



<h2 class="wp-block-heading"><strong>The Problem</strong></h2>



<p>If you change the <code>serialize_precision</code> setting from its default value of <strong>-1</strong>, the float precision will be more digits than 2 decimal places.<br />If you are not aware of this setting, it can lead to hard-to-debug issues in your application.</p>



<p>This behavior can silently break payload validation, API responses, or any logic that relies on exact string comparisons of numeric values or which assumes that float values come with 2 decimal places.</p>



<h2 class="wp-block-heading"><strong>Impact on Functions</strong></h2>



<p>When <code>serialize_precision</code> is set to something other than <strong>-1</strong>, the following functions are affected:</p>



<ul class="wp-block-list">
<li>json_encode()</li>



<li>json_decode()</li>



<li>serialize()</li>



<li>unserialize()</li>
</ul>



<p>Consider the following example.<br />Setting a high precision changes the number in the JSON output:</p>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="php"><span class="hljs-meta">&lt;?php</span>
<span class="hljs-comment">// High precision</span>
ini_set(<span class="hljs-string">"serialize_precision"</span>, <span class="hljs-number">100</span>);
<span class="hljs-keyword">echo</span> json_encode(<span class="hljs-number">12.12</span>);
<span class="hljs-comment">// Output: 12.1199999999999992184029906638897955417633056640625</span>

<span class="hljs-comment">// Default (recommended) precision</span>
ini_set(<span class="hljs-string">"serialize_precision"</span>, <span class="hljs-number">-1</span>);
<span class="hljs-keyword">echo</span> json_encode(<span class="hljs-number">12.12</span>);
<span class="hljs-comment">// Output: 12.12</span></span></code></span></pre>


<h2 class="wp-block-heading"><strong>How to Check Your Configuration</strong></h2>



<p>So better verify your current setting, especially when dealing with mysterious floating-point issues in legacy environments.<br />When on shared hosting, you might even not know that the setting was changed.</p>



<p>You can check it via code:</p>


<pre class="wp-block-code"><span><code class="hljs language-php"><span class="hljs-keyword">echo</span> ini_get(<span class="hljs-string">"serialize_precision"</span>);</code></span></pre>


<p>Or, if you are using PHP 8.5 or newer, you can conveniently check for configuration differences using the CLI:</p>


<pre class="wp-block-code"><span><code class="hljs">php --ini=diff</code></span></pre>


<p>This will highlight any settings that differ from the PHP defaults, making it much easier to spot such dangerous configurations.</p>



<h2 class="wp-block-heading"><strong>Conclusion</strong></h2>



<p>If you encounter unexpected floating-point behavior in your PHP application, check the <code>serialize_precision</code> setting first. It&#8217;s a simple fix that can save you hours of debugging.</p>



<p></p>The post <a href="https://nerdpress.org/2026/04/16/phps-serialize_precision-hidden-danger/">PHP’s serialize_precision hidden danger</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Debuggin JSON mit JSON Views</title>
		<link>https://nerdpress.org/2010/11/17/debuggin-json-mit-json-views/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Wed, 17 Nov 2010 15:37:32 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[JSON]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1214</guid>

					<description><![CDATA[<p>Wer kennt das nicht: man entwickelt mit JSON, will die AJAX Rückgabe kontrollieren und macht, wie gewohnt, im Firefox den Firebug auf und checkt unter Console den AJAX Request und sieht folgendes: Nicht sehr erhellend! Total unübersichtlich! Nicht gut! Wird JSON mit dem richtigen Header ausgeliefert, unter PHP geht der so: Dann kann man ein &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2010/11/17/debuggin-json-mit-json-views/" class="more-link">Continue reading<span class="screen-reader-text"> "Debuggin JSON mit JSON Views"</span></a></p>
The post <a href="https://nerdpress.org/2010/11/17/debuggin-json-mit-json-views/">Debuggin JSON mit JSON Views</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Wer kennt das nicht: man entwickelt mit JSON, will die AJAX Rückgabe kontrollieren und macht, wie gewohnt, im Firefox den Firebug auf und checkt unter Console den AJAX Request und sieht folgendes:<br />
<a href="https://nerdpress.org/wp-content/uploads/2010/11/json_firebug_raw.png"><img decoding="async" src="https://nerdpress.org/wp-content/uploads/2010/11/json_firebug_raw-300x70.png" alt="" title="JSON Firebug Raw View" width="300" height="70" class="alignnone size-medium wp-image-1215" /></a><br />
Nicht sehr erhellend! Total unübersichtlich! Nicht gut!</p>
<p>Wird JSON mit dem richtigen Header ausgeliefert, unter PHP geht der so:</p>
<pre class="brush: php; title: ; notranslate">
header('Content-type: application/json');
</pre>
<p><span id="more-1214"></span></p>
<p>Dann kann man ein feines Feature von Firebug nutzen:<br />
den JSON View, dieser versteckt sich unter der Response als JSON Tab.<br />
<a href="https://nerdpress.org/wp-content/uploads/2010/11/Json_view_firebug.png"><img decoding="async" src="https://nerdpress.org/wp-content/uploads/2010/11/Json_view_firebug-300x141.png" alt="" title="JSON View Firebug" width="300" height="141" class="alignnone size-medium wp-image-1216" /></a></p>
<p>Ja schon besser! Aber, ich wiederhole, nur mit dem richtigen Header, mit <em>text/html</em> o.ä. ist dieser Tab nicht zu sehen.</p>
<p>Nun gut, trotzdem ein bißchen eng da alles in der FireBug Hülle.<br />
Ich mach ja ganz gerne den Ajax Call in einem neuen Tab auf, um zu sehen ob alles drin ist.<br />
Dann empfiehlt sich ein Firefox AddOn: <a href="https://addons.mozilla.org/de/firefox/addon/10869/">JSONView</a></p>
<p>Dies rendered das JSON schön im Firefox, wenn , Ihr habts erraten, der Header stimmt: <strong>application/json</strong> !<br />
<a href="https://nerdpress.org/wp-content/uploads/2010/11/JSONViewer.png"><img fetchpriority="high" decoding="async" src="https://nerdpress.org/wp-content/uploads/2010/11/JSONViewer-300x183.png" alt="" title="JSONView Firefox AddOn" width="300" height="183" class="alignnone size-medium wp-image-1217" /></a><br />
So ist gut!</p>The post <a href="https://nerdpress.org/2010/11/17/debuggin-json-mit-json-views/">Debuggin JSON mit JSON Views</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>lawnchair &#8211; a client side JSON document store</title>
		<link>https://nerdpress.org/2009/11/25/lawnchair-a-client-side-json-document-store/</link>
					<comments>https://nerdpress.org/2009/11/25/lawnchair-a-client-side-json-document-store/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Wed, 25 Nov 2009 13:04:01 +0000</pubDate>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[async]]></category>
		<category><![CDATA[couch]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Lawnchair]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=618</guid>

					<description><![CDATA[<p>Sorta like a couch except smaller and outside JSON Daten clientseitig speichern und verfügbar halten. &#8220;stores&#8221; nennt Lawnchair das dann. Eigentlich ähnlich wie bei Propel und co. Nur halt ohne DB. ich würde sagen die Syntax spricht in dem Fall für sich selbst: var people = new Lawnchair(&#039;people&#039;); // Saving a document var me = &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2009/11/25/lawnchair-a-client-side-json-document-store/" class="more-link">Continue reading<span class="screen-reader-text"> "lawnchair &#8211; a client side JSON document store"</span></a></p>
The post <a href="https://nerdpress.org/2009/11/25/lawnchair-a-client-side-json-document-store/">lawnchair – a client side JSON document store</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<blockquote><p>Sorta like a couch except smaller and outside</p></blockquote>
<p>JSON Daten clientseitig speichern und verfügbar halten. </p>
<p>&#8220;stores&#8221; nennt <a href="http://brianleroux.github.com/lawnchair/">Lawnchair</a> das dann.<br />
Eigentlich ähnlich wie bei Propel und co. Nur halt ohne DB.</p>
<p>ich würde sagen die Syntax spricht in dem Fall für sich selbst:<span id="more-618"></span></p>
<pre class="brush: jscript; title: ; notranslate">
var people = new Lawnchair(&#039;people&#039;);



// Saving a document
var me = {name:&#039;brian&#039;};
people.save(me);
 
 
// Saving a document async
people.save({name:&#039;frank&#039;}, function(r) {
    console.log(r);
});
 
 
// Specifying your own key
people.save({key:&#039;whatever&#039;, name:&#039;dracula&#039;});



// Get that document
people.get(me.key, function(r){
    console.log(r);
});
 
 
// Returns all documents as an array to a callback
people.all(function(r){
    console.log(r);
});
 
 
// List all with shortcut syntax
people.all(&#039;console.log(r)&#039;);



// Remove a document directly
people.get(me.key, function(r){
    people.remove(me);
});
 
// Remove a document by key
people.save({key:&#039;die&#039;, name:&#039;duder&#039;});
people.remove(&#039;die&#039;);
 
// Destroy all documents
people.nuke();



</pre>The post <a href="https://nerdpress.org/2009/11/25/lawnchair-a-client-side-json-document-store/">lawnchair – a client side JSON document store</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2009/11/25/lawnchair-a-client-side-json-document-store/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>CouchDB E-Book</title>
		<link>https://nerdpress.org/2009/10/22/couchdb-e-book/</link>
					<comments>https://nerdpress.org/2009/10/22/couchdb-e-book/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 22 Oct 2009 19:02:29 +0000</pubDate>
				<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[CouchDB]]></category>
		<category><![CDATA[Document Oriented Database]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Webservice]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=449</guid>

					<description><![CDATA[<p>Eine dieser neumodischen dokumentenbasierenten Datenbanken. Ich bin über eine ausführliche Dokumentation gestolpert, nämlich gibt es das ziemlich brandneue Buch &#8220;CouchDB &#8211; The Definitive Guide&#8221; (J. Anderson, Noah Slater, Jan Lehnard, CouchDB &#8211; The Definitive Guide, ISBN 978-0-596-15589-6) von O&#8217;Reilly als E-Book zum im-Internet-angucken und umsonst. Unter dieser Adresse. Schon die ersten Kapitel machen Lust, in &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2009/10/22/couchdb-e-book/" class="more-link">Continue reading<span class="screen-reader-text"> "CouchDB E-Book"</span></a></p>
The post <a href="https://nerdpress.org/2009/10/22/couchdb-e-book/">CouchDB E-Book</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Eine dieser neumodischen dokumentenbasierenten Datenbanken. Ich bin über eine ausführliche Dokumentation gestolpert, nämlich gibt es das ziemlich brandneue Buch &#8220;CouchDB &#8211; The Definitive Guide&#8221; (<a href="http://www.amazon.de/CouchDB-The-Definitive-Guide/dp/0596155891%3FSubscriptionId%3DAKIAJKFE2V2KIXJBRHLQ%26tag%3Dnerdpressorg-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596155891">J. Anderson, Noah Slater, Jan Lehnard, CouchDB &#8211; The Definitive Guide, ISBN </a><span><a href="http://www.amazon.de/CouchDB-The-Definitive-Guide/dp/0596155891%3FSubscriptionId%3DAKIAJKFE2V2KIXJBRHLQ%26tag%3Dnerdpressorg-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596155891">978-0-596-15589-6</a>) von O&#8217;Reilly als E-Book zum im-Internet-angucken und umsonst. <a href="http://books.couchdb.org/relax/">Unter dieser Adresse</a>. Schon die ersten Kapitel machen Lust, in die Thematik zu schnuppern. Schon immer mal wollte ich via Dojo JsonRESTStore einen Webservice so richtig ansaugen und zwar ohne das lästige PHP dazwischen. Mit CouchDB scheint das auf einfachste Weise möglich zu sein.<span id="more-449"></span></span></p>
<p><span>Es ist bestimmt kein Zufall, dass ungefähr zeitgleich die nächste Ubuntu-Version vor der Tür steht, mit der <a href="http://www.canonical.com/">Canonical</a> jedem Benutzer 2 GB Speicher zu Backupzwecken schenkt &#8211; verwaltet in bzw. durch eine(r) CouchDB (ist das eigentlich noch ein DBS oder ein Webservice mit eingebautem Datenspeicher?) Jedenfalls wird das den Hype um <a href="http://couchdb.apache.org/">CouchDb</a>, <a href="http://www.mongodb.org/display/DOCS/Home">MongoDb</a> oder wie sie heißen sicher noch ein wenig anheizen. Ich bin mal sehr gespannt, hör aber jetzt erstmal auf, bis mir was qualifizierteres dazu einfällt. Das Motto gefällt mir jedenfalls sehr gut: Relax!<br />
</span></p>The post <a href="https://nerdpress.org/2009/10/22/couchdb-e-book/">CouchDB E-Book</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2009/10/22/couchdb-e-book/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
