3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scandir = scandir('c:/keycounter'); $stats = array(); foreach($scandir as $filename){ if(substr($filename, -4) !== '.day') continue; $date = substr($filename, 0, -4); $stats[$date]= array('k' => 0, 'm' => 0); $content = file_get_contents('c:/keycounter/'.$filename); $lines = explode("\n", $content); foreach($lines as $line){ if($line === '') { continue; } $exp2 = explode(",", $line); $stats[$date]['k']+=intval($exp2[0]); $stats[$date]['m']+=intval($exp2[1]); } }
Output for git.master, git.master_jit
Warning: scandir(): open_basedir restriction in effect. File(c:/keycounter) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Dcs5Q on line 2 Warning: scandir(c:/keycounter): Failed to open directory: Operation not permitted in /in/Dcs5Q on line 2 Warning: scandir(): (errno 1): Operation not permitted in /in/Dcs5Q on line 2 Warning: foreach() argument must be of type array|object, bool given in /in/Dcs5Q on line 5
Output for rfc.property-hooks
Warning: scandir(): open_basedir restriction in effect. File(c:/keycounter) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Dcs5Q on line 2 Warning: scandir(c:/keycounter): Failed to open directory: Operation not permitted in /in/Dcs5Q on line 2 Warning: scandir(): (errno 1): Operation not permitted in /in/Dcs5Q on line 2 Warning: foreach() argument must be of type array|object, false given in /in/Dcs5Q on line 5

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:
39.44 ms | 402 KiB | 8 Q