3v4l.org

run code in 300+ PHP versions simultaneously
<?php $permalink_structure = '/index2php/converter/%post_id%/'; $index = 'index.php'; $without_preg_quote = preg_match( '#^/*' . $index . '#', $permalink_structure ); $with_preg_quote = preg_match( '#^/*' . preg_quote( $index, '#' ) . '#', $permalink_structure ); echo 'Without preg_quote(): ', var_export( $without_preg_quote, true ), "\n"; echo 'With preg_quote(): ', var_export( $with_preg_quote, true ), "\n";
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Without preg_quote(): 1 With preg_quote(): 0

preferences:
55.78 ms | 406 KiB | 5 Q