3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Foo * * PHP version 7.2 * * @category Class * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech */ /** * * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.1.0 */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ namespace OpenAPI\Client\Model; use \ArrayAccess; use \OpenAPI\Client\ObjectSerializer; /** * Foo Class Doc Comment * * @category Class * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess<TKey, TValue> * @template TKey int|null * @template TValue mixed|null */ class Foo implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $openAPIModelName = 'Foo'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $openAPITypes = [ 'id' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] * @phpstan-var array<string, string|null> * @psalm-var array<string, string|null> */ protected static $openAPIFormats = [ 'id' => 'int64' ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function openAPITypes() { return self::$openAPITypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function openAPIFormats() { return self::$openAPIFormats; } /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = [ 'id' => 'id' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'id' => 'setId' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'id' => 'getId' ]; /** * Array of attributes where the key is the local name, * and the value is the original name * * @return array */ public static function attributeMap() { return self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) * * @return array */ public static function setters() { return self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) * * @return array */ public static function getters() { return self::$getters; } /** * The original name of the model. * * @return string */ public function getModelName() { return self::$openAPIModelName; } /** * Associative array for storing property values * * @var mixed[] */ protected $container = []; /** * Constructor * * @param mixed[] $data Associated array of property values * initializing the model */ public function __construct(array $data = null) { $this->container['id'] = $data['id'] ?? null; } /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalidProperties = parent::listInvalidProperties(); return $invalidProperties; } /** * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets id * * @return int|null */ public function getId() { return $this->container['id']; } /** * Sets id * * @param int|null $id id * * @return self */ public function setId($id) { $this->container['id'] = $id; return $this; } /** * Returns true if offset exists. False otherwise. * * @param integer $offset Offset * * @return boolean */ public function offsetExists($offset) { return isset($this->container[$offset]); } /** * Gets offset. * * @param integer $offset Offset * * @return mixed|null */ public function offsetGet($offset) { return $this->container[$offset] ?? null; } /** * Sets value based on offset. * * @param int|null $offset Offset * @param mixed $value Value to be set * * @return void */ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * Unsets offset. * * @param integer $offset Offset * * @return void */ public function offsetUnset($offset) { unset($this->container[$offset]); } /** * Serializes the object to a value that can be serialized natively by json_encode(). * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); } /** * Gets the string presentation of the object * * @return string */ public function __toString() { return json_encode( ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT ); } /** * Gets a header-safe presentation of the object * * @return string */ public function toHeaderValue() { return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.120.0130.00719.55
8.4.110.0050.00518.07
8.4.100.0120.00917.64
8.4.90.0120.00720.48
8.4.80.0060.01118.83
8.4.70.0120.00718.75
8.4.60.0120.00920.66
8.4.50.0130.00718.37
8.4.40.0100.01017.81
8.4.30.0140.00720.25
8.4.20.0070.01418.80
8.4.10.0140.00619.32
8.3.250.0110.00816.51
8.3.240.0120.00716.63
8.3.230.0080.01216.87
8.3.220.0070.00118.76
8.3.210.0100.00316.63
8.3.200.0050.00416.59
8.3.190.0050.00316.91
8.3.180.0100.00818.98
8.3.170.0060.01218.76
8.3.160.0160.00618.52
8.3.150.0140.00419.10
8.3.140.0090.01220.65
8.3.130.0030.00618.49
8.3.120.0040.00418.73
8.3.110.0040.00420.94
8.3.100.0000.01018.14
8.3.90.0040.00426.77
8.3.80.0030.00619.36
8.3.70.0120.01216.75
8.3.60.0150.00018.31
8.3.50.0130.00616.17
8.3.40.0000.01518.90
8.3.30.0120.00318.55
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0030.00616.80
8.2.280.0030.00520.20
8.2.270.0130.00616.93
8.2.260.0030.00617.01
8.2.250.0060.00316.50
8.2.240.0120.00016.96
8.2.230.0030.00622.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0070.00718.88
8.2.190.0100.01018.17
8.2.180.0110.00425.92
8.2.170.0110.00718.82
8.2.160.0120.00322.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0060.00326.35
8.2.110.0040.00420.43
8.2.100.0080.00417.66
8.2.90.0000.00817.50
8.2.80.0000.00818.42
8.2.70.0000.01017.25
8.2.60.0000.00817.91
8.2.50.0000.00918.07
8.2.40.0060.00618.09
8.2.30.0040.00418.11
8.2.20.0030.00617.83
8.2.10.0000.00820.88
8.2.00.0080.00019.19
8.1.330.0100.00916.00
8.1.320.0110.00918.07
8.1.310.0100.00716.69
8.1.300.0130.00618.04
8.1.290.0000.01230.84
8.1.280.0140.00025.92
8.1.270.0030.00523.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00018.93
8.1.230.0110.00017.57
8.1.220.0070.00017.74
8.1.210.0000.00918.77
8.1.200.0000.01017.23
8.1.190.0050.00516.98
8.1.180.0000.00818.10
8.1.170.0050.00318.64
8.1.160.0040.00418.64
8.1.150.0040.00418.80
8.1.140.0040.00418.85
8.1.130.0080.00019.97
8.1.120.0030.00517.39
8.1.110.0030.00617.38
8.1.100.0040.00417.39
8.1.90.0040.00417.26
8.1.80.0000.00717.43
8.1.70.0040.00417.40
8.1.60.0050.00217.37
8.1.50.0000.00817.25
8.1.40.0080.00017.47
8.1.30.0060.00317.57
8.1.20.0050.00317.39
8.1.10.0040.00417.39
8.1.00.0030.00617.33
8.0.300.0000.00918.77
8.0.290.0040.00416.63
8.0.280.0030.00318.36
8.0.270.0070.00017.98
8.0.260.0000.00718.36
8.0.250.0080.00016.93
8.0.240.0080.00016.91
8.0.230.0040.00416.95
8.0.220.0030.00316.83
8.0.210.0050.00316.91
8.0.200.0070.00016.91
8.0.190.0030.00516.91
8.0.180.0040.00416.87
8.0.170.0090.00016.88
8.0.160.0050.00316.80
8.0.150.0050.00216.76
8.0.140.0000.00716.87
8.0.130.0000.00513.37
8.0.120.0000.00816.76
8.0.110.0040.00416.97
8.0.100.0070.00016.68
8.0.90.0030.00316.73
8.0.80.0080.00816.75
8.0.70.0000.00716.84
8.0.60.0040.00416.87
8.0.50.0020.00516.76
8.0.30.0060.01516.89
8.0.20.0090.01216.87
8.0.10.0070.00716.95
8.0.00.0150.00616.94
7.4.330.0040.00415.55
7.4.320.0000.00716.48
7.4.300.0000.00716.47
7.4.290.0070.00016.40
7.4.280.0070.00016.48
7.4.270.0000.00816.58
7.4.260.0030.00313.14
7.4.250.0000.00716.52
7.4.240.0000.00716.59
7.4.230.0040.00416.43
7.4.220.0030.00316.48
7.4.210.0050.01216.61
7.4.200.0030.00316.55
7.4.160.0070.01316.66
7.4.150.0060.01016.48
7.4.140.0140.00816.41
7.4.130.0120.00616.34
7.4.120.0120.01216.47
7.4.110.0060.01216.40
7.4.100.0110.00816.54
7.4.90.0170.00416.54
7.4.80.0140.00916.35
7.4.70.0050.01716.38
7.4.60.0110.01116.54
7.4.50.0110.01216.46
7.4.40.0080.00916.46
7.4.30.0140.00416.49
7.4.20.0100.01016.42
7.4.10.0090.00916.32
7.4.00.0160.00616.57
7.3.330.0000.00816.04
7.3.320.0030.00313.13
7.3.310.0030.00316.32
7.3.300.0040.00416.23
7.3.290.0080.00916.27
7.3.270.0000.01616.33
7.3.260.0110.00816.19
7.3.250.0130.00316.31
7.3.240.0080.01216.18
7.3.230.0140.00616.25
7.3.220.0030.01616.25
7.3.210.0110.01116.16
7.3.200.0060.01516.14
7.3.190.0190.00316.27
7.3.180.0060.01016.25
7.3.170.0060.01216.25
7.3.160.0140.00316.28
7.3.150.0090.00916.26
7.3.140.0110.01116.31
7.3.130.0140.00616.28
7.3.120.0070.01416.19
7.3.110.0030.01716.15
7.3.100.0080.01216.13
7.3.90.0080.01016.44
7.3.80.0040.01216.18
7.3.70.0180.00616.33
7.3.60.0040.01616.33
7.3.50.0070.01116.34
7.3.40.0060.01416.29
7.3.30.0060.00916.42
7.3.20.0070.01016.35
7.3.10.0120.00816.25
7.3.00.0140.00716.32

preferences:
51.49 ms | 403 KiB | 5 Q