3v4l.org

run code in 300+ PHP versions simultaneously
<?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();

preferences:
23.49 ms | 406 KiB | 5 Q