3v4l.org

run code in 300+ PHP versions simultaneously
<?php method_exists('SplFileObject', 'fread') or die("No SplFileObject::fread()"); $i=0; $file = new SplFileObject(__FILE__); while ($file->valid()) { $chunk = $file->fread(20); $hex = array_map(function ($char) { return sprintf('%02X', ord($char)); }, str_split($chunk)); printf("%s %s\n", implode(' ', $hex), preg_replace('/[[:print:]]/', '.', $chunk)); }

preferences:
45.43 ms | 402 KiB | 5 Q