3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = 'aaaaaaaaaa.bbbbbbbbbbb.cccccccccccc.dddddddddd.eeeeeeeeee.fffffffff.gggggggggg.hhhhhhhhh'; $max = 10; $retry = 1; do { echo $test . "\n"; // preg_match("/^.+?\.(.+)$/", $test, $result); // if (0 === preg_match("/^.+?\.(.+)$/", $test, $matches)) throw new \InvalidArgumentException('invalid'); if (0 === preg_match("/^[^.]+\.(.+)$/", $test, $matches)) throw new \InvalidArgumentException('invalid'); $test = $matches[1]; } while ($retry++ < $max);
Output for 5.6.19
aaaaaaaaaa.bbbbbbbbbbb.cccccccccccc.dddddddddd.eeeeeeeeee.fffffffff.gggggggggg.hhhhhhhhh bbbbbbbbbbb.cccccccccccc.dddddddddd.eeeeeeeeee.fffffffff.gggggggggg.hhhhhhhhh cccccccccccc.dddddddddd.eeeeeeeeee.fffffffff.gggggggggg.hhhhhhhhh dddddddddd.eeeeeeeeee.fffffffff.gggggggggg.hhhhhhhhh eeeeeeeeee.fffffffff.gggggggggg.hhhhhhhhh fffffffff.gggggggggg.hhhhhhhhh gggggggggg.hhhhhhhhh hhhhhhhhh Fatal error: Uncaught exception 'InvalidArgumentException' with message 'invalid' in /in/gNPLg:10 Stack trace: #0 {main} thrown in /in/gNPLg on line 10
Process exited with code 255.