3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function printIncrementAndShard($id) { $increment = $id >> 8; $shard = ($id & 0xFF); echo $id . ' = ' . $increment . '.' . $shard . PHP_EOL; } printIncrementAndShard(0x00000100); printIncrementAndShard(0x00000101); printIncrementAndShard(0x12345678); printIncrementAndShard(0xFFFFFFFF);
based on i0jhf
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
256 = 1.0 257 = 1.1 305419896 = 1193046.120 4294967295 = 16777215.255
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/JXQME on line 8 256 = 1.0PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/JXQME on line 8 257 = 1.1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/JXQME on line 8 305419896 = 1193046.120PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/JXQME on line 8 4294967295 = 16777215.255PHP_EOL