3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Stripe; class Stripe{ protected $apiKey; protected $apiBase = 'https://api.stripe.com'; protected $apiUploadBase = 'https://uploads.stripe.com'; protected $version = '1.0.0'; protected $apiVersion = null; /* @return string API key */ public function getApiKey(){ return $this->apiKey; } /* @param $apiKey * Sets API Key for requests */ public function setApiKey($apiKey){ $this->apiKey = $apiKey; return $this; } /* @return string * return library version */ protected function getVersion(){ return $this->version; } /* * @return string * returns API version for requests; Null if not set. */ protected function getApiVersion(){ return $this->apiVersion; } /* * @param $version * Set API version for requests */ public function setApiVersion($version){ $this->apiVersion = $version; return $this; } } $stripe = new Stripe; $stripe->setApiKey('abc123')->setApiVersion('apiVersion'); $apikey = $stripe->getApiKey(); $apivers = $stripe->getApiVersion(); echo $apikey . PHP_EOL; echo $apivers . PHP_EOL;
based on qHXYh
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Error: Call to protected method Stripe\Stripe::getApiVersion() from context '' in /in/ZVirk:60 Stack trace: #0 {main} thrown in /in/ZVirk on line 60
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Call to protected Stripe\Stripe::getApiVersion() from invalid context in /in/ZVirk:60 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Call to protected method Stripe\Stripe::getApiVersion() from context '' in /in/ZVirk on line 60
Process exited with code 255.