<?php
$tests = 1000000 ;
for ( $i = 1 ; $i <= $tests ; $i += 1 ) {
preg_match ( '/a*b/' , 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac' ) ; }
printf ( "For /a*b/ : %1.15f per iteration for %s iterations\n " , ( $stop - $start ) / $tests , $tests ) ;
for ( $i = 1 ; $i <= $tests ; $i += 1 ) {
preg_match ( '/(?>a*)b/' , 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac' ) ; }
printf ( "For /(?>a*)b/: %1.15f per iteration for %s iterations\n " , ( $stop - $start ) / $tests , $tests ) ;
for ( $i = 1 ; $i <= $tests ; $i += 1 ) {
preg_match ( '/a*+b/' , 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac' ) ; }
printf ( "For /a*+b/ : %1.15f per iteration for %s iterations\n " , ( $stop - $start ) / $tests , $tests ) ;
for ( $i = 1 ; $i <= $tests ; $i += 1 ) {
preg_match ( '/(?>a)*b/' , 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac' ) ; }
printf ( "For /(?>a)*b/: %1.15f per iteration for %s iterations\n " , ( $stop - $start ) / $tests , $tests ) ;
PD9waHAKCiR0ZXN0cyA9IDEwMDAwMDA7Cgokc3RhcnQgPSBtaWNyb3RpbWUoIFRSVUUgKTsKZm9yKCAkaSA9IDE7ICRpIDw9ICR0ZXN0czsgJGkgKz0gMSApIHsKCXByZWdfbWF0Y2goJy9hKmIvJywnYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWMnKTsKfQokc3RvcCA9IG1pY3JvdGltZSggVFJVRSApOwoKcHJpbnRmKCAiRm9yIC9hKmIvICAgIDogJTEuMTVmIHBlciBpdGVyYXRpb24gZm9yICVzIGl0ZXJhdGlvbnNcbiIsICgkc3RvcCAtICRzdGFydCkvJHRlc3RzLCAkdGVzdHMgKTsKdW5zZXQoICRzdG9wLCAkc3RhcnQgKTsKCiRzdGFydCA9IG1pY3JvdGltZSggVFJVRSApOwpmb3IoICRp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