3v4l.org

run code in 300+ PHP versions simultaneously
<?php $templateBody = '<p>Dear [#applicant_name_forename],</p> <p>We have received your application for a criminal record check with [#company_name] and have processed your ID documents. These will be posted back to you today via Royal Mail. The tracking number for these items is [#docs_recorded_delivery_receipt] and you can view their return progress via the Royal Mail website:</p> <p>http://www.royalmail.com/trackdetails</p> <p>Tracking is available after 5pm today.</p> <p>For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages:</p> <p>http://www.ddc.uk.net/help-advice/dbs-checkfaqs/</p> <p>Regards</p> <p>DDC Countersignatory Team</p>'; $emailBody = 'Dear Morty, We have received your application for a criminal record check with Galatic Federation and have processed your ID documents. These will be posted back to you today via Courier Flap. The tracking number for these items is 123123123 and you can view their return progress via the Courier Flap website: http://www.courierflap.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team'; $templateBody = strip_tags($templateBody); $emailBody = strip_tags($emailBody); var_dump($templateBody); var_dump($emailBody); $templateBody = preg_replace('/^\s+/m', '', $templateBody); $emailBody = preg_replace('/^\s+/m', '', $emailBody); $templateBody = preg_replace( [ '/' . preg_quote('[#applicant_name_forename]') . '/', '/' . preg_quote('[#company_name]') . '/', '/' . preg_quote('[#docs_recorded_delivery_receipt]') . '/' ], 'TEMPORARYREPLACER', $templateBody ); $templateBody = preg_quote($templateBody, '/'); $templateBody = preg_replace('/TEMPORARYREPLACER/', '(.*)', $templateBody); preg_match('/' . $templateBody . '/', $emailBody, $matches); var_dump($matches);
Output for 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
string(640) "Dear [#applicant_name_forename], We have received your application for a criminal record check with [#company_name] and have processed your ID documents. These will be posted back to you today via Royal Mail. The tracking number for these items is [#docs_recorded_delivery_receipt] and you can view their return progress via the Royal Mail website: http://www.royalmail.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team" string(611) "Dear Morty, We have received your application for a criminal record check with Galatic Federation and have processed your ID documents. These will be posted back to you today via Courier Flap. The tracking number for these items is 123123123 and you can view their return progress via the Courier Flap website: http://www.courierflap.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team" array(0) { }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 string(640) "Dear [#applicant_name_forename], We have received your application for a criminal record check with [#company_name] and have processed your ID documents. These will be posted back to you today via Royal Mail. The tracking number for these items is [#docs_recorded_delivery_receipt] and you can view their return progress via the Royal Mail website: http://www.royalmail.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team" string(611) "Dear Morty, We have received your application for a criminal record check with Galatic Federation and have processed your ID documents. These will be posted back to you today via Courier Flap. The tracking number for these items is 123123123 and you can view their return progress via the Courier Flap website: http://www.courierflap.com/trackdetails Tracking is available after 5pm today. For more information about checking the progress of your application or general enquiries on the process please view our FAQ pages: http://www.ddc.uk.net/help-advice/dbs-checkfaqs/ Regards DDC Countersignatory Team" array(0) { }

preferences:
174.14 ms | 405 KiB | 216 Q