3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once("TwitterAPIExchange.php"); class Tweet extends TwitterAPIExchange { //Enter your details here const oauth_token = "16127841-XhE5Xlw8bArFmSyouf4y9AHx9KUJ2SrpL95994QV0"; const oauth_secret = "wtmbZlSntIXpKqiq4mIDmY1JqqmsIP6FCy1UyHRI9DuJ6"; const consumer_key = "hccV6YwzcYC9bjaTnbC6W6h2D"; const consumer_secret = "OucJEZ0GR6PgGSHZje0DLSmGdSmyXx9b0CWiSGVwla1jzApSdM"; public $json; public $get; private $twitter; public function __construct() { $settings = array('oauth_access_token' => self::oauth_token, 'oauth_access_token_secret' => self::oauth_secret, 'consumer_key' => self::consumer_key, 'consumer_secret' => self::consumer_secret); $this->twitter = new TwitterAPIExchange($settings); return $this; } public function set($json, $get) { $this->json = "https://api.twitter.com/1.1/".$json.".json"; if(is_array($get)) { $this->get = http_build_query($get); } else { $this->get = $get; } return $this; } public function call() { $response=$this->twitter->setGetfield("?".$this->get) ->buildOauth($this->json, "GET") ->performRequest(); $response=json_decode($response, true); return (array) $response; } } ?>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: require_once(): open_basedir restriction in effect. File(TwitterAPIExchange.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/I7S10 on line 2 Warning: require_once(TwitterAPIExchange.php): Failed to open stream: Operation not permitted in /in/I7S10 on line 2 Fatal error: Uncaught Error: Failed opening required 'TwitterAPIExchange.php' (include_path='.:') in /in/I7S10:2 Stack trace: #0 {main} thrown in /in/I7S10 on line 2
Process exited with code 255.
Output for 8.0.13
Warning: require_once(TwitterAPIExchange.php): Failed to open stream: No such file or directory in /in/I7S10 on line 2 Fatal error: Uncaught Error: Failed opening required 'TwitterAPIExchange.php' (include_path='.:') in /in/I7S10:2 Stack trace: #0 {main} thrown in /in/I7S10 on line 2
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7, 7.3.32 - 7.3.33, 7.4.33
Warning: require_once(TwitterAPIExchange.php): failed to open stream: No such file or directory in /in/I7S10 on line 2 Fatal error: require_once(): Failed opening required 'TwitterAPIExchange.php' (include_path='.:') in /in/I7S10 on line 2
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.32
Warning: require_once(): open_basedir restriction in effect. File(TwitterAPIExchange.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/I7S10 on line 2 Warning: require_once(TwitterAPIExchange.php): failed to open stream: Operation not permitted in /in/I7S10 on line 2 Fatal error: require_once(): Failed opening required 'TwitterAPIExchange.php' (include_path='.:') in /in/I7S10 on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: main(TwitterAPIExchange.php): failed to open stream: No such file or directory in /in/I7S10 on line 2 Fatal error: main(): Failed opening required 'TwitterAPIExchange.php' (include_path='.:') in /in/I7S10 on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/I7S10 on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/I7S10 on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/I7S10 on line 8
Process exited with code 255.

preferences:
233.51 ms | 401 KiB | 351 Q