3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = "2013-12-09"; if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) { print_r( $regs ); } else { echo "Invalid date format: $date"; }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function ereg() in /in/VMpeQ:3 Stack trace: #0 {main} thrown in /in/VMpeQ on line 3
Process exited with code 255.
Output for 4.3.0 - 5.2.17, hhvm-3.10.0 - 3.12.0
Array ( [0] => 2013-12-09 [1] => 2013 [2] => 12 [3] => 09 )
Output for 5.3.0 - 5.6.28
Deprecated: Function ereg() is deprecated in /in/VMpeQ on line 3 Array ( [0] => 2013-12-09 [1] => 2013 [2] => 12 [3] => 09 )