- var_dump: documentation ( source)
- preg_match: documentation ( source)
- ini_set: documentation ( source)
<?php
// Toggle regex JIT:
$iniSetSuccessfully = ini_set( "pcre.jit", "1" );
if ( $iniSetSuccessfully === false )
{
throw new \Exception( "Unable to set pcre.jit" );
}
// Test
echo "\nTest with JIT enabled:\n";
preg_match( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '<br><div id="S44_i89ew">', $matches );
var_dump( $matches );
// PCRE info ( not available on 3v4l.org )
$pcreReflector = new ReflectionExtension("pcre");
$pcreReflector->info();
$iniSetSuccessfully = ini_set( "pcre.jit", "0" );
if ( $iniSetSuccessfully === false )
{
throw new \Exception( "Unable to set pcre.jit" );
}
echo "\nTest with JIT disabled:\n";
// Test ( Note regex must be changed to prevent caching )
preg_match( '/<(\w+)[\s\w\-]+ id="S44_123">/', '<br><div id="S44_123">', $matches );
var_dump( $matches );
// PCRE info
$pcreReflector = new ReflectionExtension("pcre");
$pcreReflector->info();