3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Attempt to reproduce "element" issue $url = urldecode( "eng%C3%A5%C2%BF%C2/Products" ); $elements = explode( '/', $url ); #$elements = array( "eng%C3%A5%C2%BF%C2", "Products" );// url, exploded by "/" var_dump($elements) $saList = array( "eng", "fre" ); $URIMatchElement = 1;// URIMatchElement setting $elements = array_slice( $elements, 0, $URIMatchElement ); $name = implode( '_', $elements ); $name = preg_replace( array( '/[^a-zA-Z0-9]+/', '/_+/', '/^_/', '/_$/' ), array( '_', '_', '', '' ), $name ); echo $name . "\n"; echo (in_array( $name, $saList ) ? "is valid sa" : "is not valid sa");// if issue is true, then this should be true
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '$saList' (T_VARIABLE) in /in/PqtvP on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/PqtvP on line 9
Process exited with code 255.