3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function contextCheck( $context = false ) { # URL Paremeter Checker # If the infomation passed is a string and isn't empty, grab URL paremeter if( !empty( $context ) and is_string( $context ) ) { # Check if the URL Parameter even exists if ( isset( $_GET["{$context}"] ) ) { $URL_Parameter = $_GET["{$context}"]; # If the URL Parameter is a string and isn't empty, return true if( !empty( $URL_Parameter ) and is_string( $URL_Parameter ) ) { return $URL_Parameter; } } } else { return false; } } $_GET['foo' => '12']; $_GET['bar' => '0']; print( contextCheck( 'foo' ) ); print( contextCheck( 'bar' ) ); ?>
Output for 5.4.0 - 5.5.8
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ']' in /in/8l9Vj on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ']' in /in/8l9Vj on line 23
Process exited with code 255.