3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to protected method Stripe\Stripe::getApiVersion() from global scope in /in/ZVirk:60 Stack trace: #0 {main} thrown in /in/ZVirk on line 60
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.6 ms | 401 KiB | 8 Q