3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array("number"=>"3","string"=>"abc","null"=>null); $ncache=array(); $scache=array(); foreach(range(1,10000) as $it) { $ncache[]=$array; $scache[]=$array; } function ncompress(&$v) { if(is_numeric($v)) $v=floatval($v); elseif(is_string($v)) $v=trim($v); elseif(is_null($v)) $v=null; } function scompress(&$v) { if(is_numeric($v)) $v=floatval($v); elseif(is_string($v)) $v=trim($v); elseif(is_null($v)) $v=""; } array_walk_recursive($ncache,"ncompress"); array_walk_recursive($scache,"scompress"); echo "Length of null : ".strlen(json_encode($ncache)) .' ('.strlen(gzdeflate(json_encode($ncache))).')'; echo "\n"; echo "Length of string: ".strlen(json_encode($scache)) .' ('.strlen(gzdeflate(json_encode($scache))).')';
Output for git.master, git.master_jit, rfc.property-hooks
Length of null : 400001 (1223) Length of string: 380001 (1163)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
33.81 ms | 401 KiB | 8 Q