3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $zakres_valid = '^ST-[0-9]{5,8}$'; $zakres = array(); $st = 'ST-856549'; for($i=0;$i<10;$i++){ $zakres[] = $st; $st++; } var_dump($zakres); for($i=0;$i<10;$i++){ if(!preg_match($zakres_valid, $zakres[$i])){ echo "/".$zakres_valid.", ".$zakres."/"; echo "ERROR. Numer $zakres[$i] z podanego zakresu nie pasuje do wzorca.<br />"; } else { echo "OK"; } } ?>
based on RoOEf
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
array(10) { [0]=> string(9) "ST-856549" [1]=> string(9) "ST-856550" [2]=> string(9) "ST-856551" [3]=> string(9) "ST-856552" [4]=> string(9) "ST-856553" [5]=> string(9) "ST-856554" [6]=> string(9) "ST-856555" [7]=> string(9) "ST-856556" [8]=> string(9) "ST-856557" [9]=> string(9) "ST-856558" } Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856549 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856550 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856551 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856552 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856553 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856554 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856555 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856556 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856557 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856558 z podanego zakresu nie pasuje do wzorca.<br />
Output for hhvm-3.10.0 - 3.12.0
array(10) { [0]=> string(9) "ST-856549" [1]=> string(9) "ST-856550" [2]=> string(9) "ST-856551" [3]=> string(9) "ST-856552" [4]=> string(9) "ST-856553" [5]=> string(9) "ST-856554" [6]=> string(9) "ST-856555" [7]=> string(9) "ST-856556" [8]=> string(9) "ST-856557" [9]=> string(9) "ST-856558" } Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856549 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856550 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856551 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856552 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856553 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856554 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856555 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found: [^ST-[0-9]{5,8}$] in /in/4sevY on line 14 Notice: Array to string conversion in /in/4sevY on line 15 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856556 z podanego zakresu nie pasuje do wzorca.<br />/^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856557 z podanego zakresu nie pasuje do wzorca.<br />/^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856558 z podanego zakresu nie pasuje do wzorca.<br />
Output for 4.3.11 - 5.3.29
array(10) { [0]=> string(9) "ST-856549" [1]=> string(9) "ST-856550" [2]=> string(9) "ST-856551" [3]=> string(9) "ST-856552" [4]=> string(9) "ST-856553" [5]=> string(9) "ST-856554" [6]=> string(9) "ST-856555" [7]=> string(9) "ST-856556" [8]=> string(9) "ST-856557" [9]=> string(9) "ST-856558" } Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856549 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856550 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856551 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856552 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856553 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856554 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856555 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856556 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856557 z podanego zakresu nie pasuje do wzorca.<br /> Warning: preg_match(): No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856558 z podanego zakresu nie pasuje do wzorca.<br />
Output for 4.3.0 - 4.3.10
array(10) { [0]=> string(9) "ST-856549" [1]=> string(9) "ST-856550" [2]=> string(9) "ST-856551" [3]=> string(9) "ST-856552" [4]=> string(9) "ST-856553" [5]=> string(9) "ST-856554" [6]=> string(9) "ST-856555" [7]=> string(9) "ST-856556" [8]=> string(9) "ST-856557" [9]=> string(9) "ST-856558" } Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856549 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856550 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856551 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856552 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856553 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856554 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856555 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856556 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856557 z podanego zakresu nie pasuje do wzorca.<br /> Warning: No ending delimiter '^' found in /in/4sevY on line 14 /^ST-[0-9]{5,8}$, Array/ERROR. Numer ST-856558 z podanego zakresu nie pasuje do wzorca.<br />