3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matches = array(); preg_match('/$([0-9]+) *- *\.html^/', "2-blabla.html", matches); vard_dump($matches);
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "matches" in /in/cQ8C1:4 Stack trace: #0 {main} thrown in /in/cQ8C1 on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.21, 5.4.0 - 5.4.11
Fatal error: Only variables can be passed by reference in /in/cQ8C1 on line 4
Process exited with code 255.

preferences:
57.82 ms | 402 KiB | 61 Q