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 (ereg ($pattern, $line))?"1":"0"; echo "\n"; }
Output for 7.0.0 - 7.1.0
dog|c*t=>"d": Fatal error: Uncaught Error: Call to undefined function ereg() in /in/lt0aX:18 Stack trace: #0 /in/lt0aX(2): t_ereg('d') #1 {main} thrown in /in/lt0aX on line 18
Process exited with code 255.
Output for 4.3.0 - 5.2.17, hhvm-3.10.0 - 3.12.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
Output for 5.3.0 - 5.6.28
dog|c*t=>"d": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 0 dog|c*t=>"c": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 0 dog|c*t=>"ct": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1 dog|c*t=>"coat": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1 dog|c*t=>"do": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 0 dog|c*t=>"dog": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1 dog|c*t=>"dogcat": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1 dog|c*t=>"docat": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1 dog|c*t=>"doc": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 0 dog|c*t=>"cat": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1 dog|c*t=>"c1234abct": Deprecated: Function ereg() is deprecated in /in/lt0aX on line 18 1