3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php t_ereg("d"); t_ereg("c"); t_ereg("ct"); t_ereg("coat"); t_ereg("do"); t_ereg("dog"); t_ereg("dogcat"); t_ereg("docat"); t_ereg("doc"); t_ereg("cat"); t_ereg("c1234abct"); function t_ereg ( $line ) { $pattern='dog|c*t'; echo "$pattern=>\"$line\":"; echo (preg_match("/$pattern/", $line))?"1":"0"; echo "\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
dog|c*t=>"d":0 dog|c*t=>"c":0 dog|c*t=>"ct":1 dog|c*t=>"coat":1 dog|c*t=>"do":0 dog|c*t=>"dog":1 dog|c*t=>"dogcat":1 dog|c*t=>"docat":1 dog|c*t=>"doc":0 dog|c*t=>"cat":1 dog|c*t=>"c1234abct":1