3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '12-34-56-78'; $pattern = '/^\d{2}(?|(---)|(-)|(\.)|(\:))\d{2}\1\d{2}\1\d{2}$/'; $result = preg_match($pattern, $string); var_dump($result); var_dump(PCRE_VERSION);
Output for 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
int(1) string(16) "10.44 2024-06-07"
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.0 - 8.3.28
int(1) string(16) "10.42 2022-12-12"
Output for 8.2.0 - 8.2.29
int(1) string(16) "10.40 2022-04-14"
Output for 8.1.1 - 8.1.33
int(1) string(16) "10.39 2021-10-29"
Output for 8.1.0
int(1) string(16) "10.37 2021-05-26"
Output for 7.4.12 - 7.4.33, 8.0.0 - 8.0.30
int(1) string(16) "10.35 2020-05-09"
Output for 7.4.6 - 7.4.11
int(1) string(16) "10.34 2019-11-21"
Output for 7.4.0 - 7.4.5
int(1) string(16) "10.33 2019-04-16"
Output for 7.3.0 - 7.3.33
int(1) string(16) "10.32 2018-09-10"
Output for 7.2.0 - 7.2.33
int(0) string(15) "8.41 2017-07-05"
Output for 7.0.3 - 7.0.33, 7.1.0 - 7.1.33
int(0) string(15) "8.38 2015-11-23"
Output for 7.0.0 - 7.0.2
int(0) string(15) "8.37 2015-04-28"
Output for 5.6.18 - 5.6.40
int(1) string(15) "8.38 2015-11-23"
Output for 5.6.11 - 5.6.17
int(1) string(15) "8.37 2015-04-28"
Output for 5.6.9 - 5.6.10
int(1) string(15) "8.36 2014-09-26"
Output for 5.6.0 - 5.6.8
int(1) string(15) "8.34 2013-12-15"

preferences:
195.1 ms | 428 KiB | 5 Q