3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SubObject { static $instances = 0; public $instance; public function __construct() { $this->instance = ++self::$instances; } } class MyCloneable { public $object1; public $object2; } /* class MyCloneable { public function __invoke($object1,$object2) { $this->oject1=$object1; $this->oject2=$object2; } }*/ $obj = new MyCloneable(); $obj->object1 = new SubObject(); $obj->object2 = new SubObject(); $obj2= new $obj->object1 && new $obj->object2 print("Oggetto originale:\n"); print_r($obj); print("Oggetto originale:\n"); print_r($obj2); ?>

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)
5.5.30.0070.05019.43
5.5.20.0130.06319.34
5.5.10.0070.07019.31
5.5.00.0030.07319.59
5.4.190.0100.07319.07
5.4.180.0070.07019.04
5.4.170.0000.07018.84
5.4.160.0100.07719.04
5.4.150.0070.08019.13
5.4.140.0030.07716.34
5.4.130.0030.06316.37
5.4.120.0030.04016.45
5.4.110.0070.06316.45
5.4.100.0070.03716.35
5.4.90.0030.06316.52
5.4.80.0000.04016.42
5.4.70.0000.04016.49
5.4.60.0070.05016.28
5.4.50.0070.06316.28
5.4.40.0000.04016.38
5.4.30.0070.05316.27
5.4.20.0070.06716.34
5.4.10.0070.03316.50
5.4.00.0070.03315.99
5.3.270.0130.06014.67
5.3.260.0000.05014.63
5.3.250.0130.05714.68
5.3.240.0030.05714.75
5.3.230.0200.03714.65
5.3.220.0030.05014.56
5.3.210.0000.04714.64
5.3.200.0100.05014.71
5.3.190.0070.06014.71
5.3.180.0000.05314.45
5.3.170.0100.03314.64
5.3.160.0030.05314.64
5.3.150.0270.05314.72
5.3.140.0130.06014.56
5.3.130.0000.04314.51
5.3.120.0070.08014.55
5.3.110.0070.05014.62
5.3.100.0070.03714.04
5.3.90.0000.04014.02
5.3.80.0070.03314.07
5.3.70.0000.04013.94
5.3.60.0070.03314.07
5.3.50.0070.03313.96
5.3.40.0070.03314.04
5.3.30.0070.03013.98
5.3.20.0000.03713.64
5.3.10.0000.03713.82
5.3.00.0030.03313.68

preferences:
141 ms | 1394 KiB | 7 Q