3v4l.org

run code in 300+ PHP versions simultaneously
<?php $celda_anio_ini = 'v.2009;2009'; $celda_anio_fin = 'v.2017;2017'; if(preg_match('/.*(Jan|Feb)?\s([\d]{4})\-/' , $celda_anio_ini, $result)) { $anio_ini = $result[2]; }elseif(preg_match('/.*[A-Za-z]{3}\s([\d]{4})\-/' , $celda_anio_ini, $result)) { $anio_ini = '('.$result[1].')'; } if(preg_match('/.*\-(Nov|Dec)?\s([\d]{4})/' , $celda_anio_fin, $result)) { $anio_fin = $result[2]; }elseif(preg_match('/.*\-[A-Za-z]{3}\s([\d]{4})/' , $celda_anio_fin, $result)) { $anio_fin = '('.$result[1].')'; } echo "$celda_anio_ini, $celda_anio_fin\n..."; echo "$anio_ini - $anio_fin\n\n";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
v.2009;2009, v.2017;2017 ... Warning: Undefined variable $anio_ini in /in/CBTOq on line 19 Warning: Undefined variable $anio_fin in /in/CBTOq on line 19 -
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
v.2009;2009, v.2017;2017 ... Notice: Undefined variable: anio_ini in /in/CBTOq on line 19 Notice: Undefined variable: anio_fin in /in/CBTOq on line 19 -
Output for 7.3.32 - 7.3.33
v.2009;2009, v.2017;2017 ... -

preferences:
155.94 ms | 401 KiB | 189 Q