3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SubObject { static $instances = 0; public $instance; public function __construct() { $this->instance = ++self::$instances; echo self::$instances; } public function __clone() { $this->instance = ++self::$instances; } } } class MyCloneable { /* public $object1; public $object2; */ function __clone() { // forza la copia di $this->object1, che altrimenti // punterebbe alla stessa istanza. $this->object1 = clone $this->object1; } 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; $obj2->object1 = new SubObject(); $obj2->object2 = new SubObject(); $obj3 = clone $obj; print("Oggetto originale:\n"); print_r($obj); print("Oggetto originale:\n"); print_r($obj2); print("Oggetto clonato:\n"); print_r($obj3); echo SubObject::$instances; ?>

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.4.190.0180.04112.40
5.4.180.0150.04312.40
5.4.170.0170.04312.41
5.4.160.0110.04812.40
5.4.150.0140.04512.39
5.4.140.0200.04312.09
5.4.130.0170.04412.07
5.4.120.0170.04012.04
5.4.110.0140.04412.03
5.4.100.0150.04312.03
5.4.90.0160.04212.03
5.4.80.0330.09012.03
5.4.70.0170.03912.03
5.4.60.0150.04312.02
5.4.50.0150.04312.03
5.4.40.0200.04012.01
5.4.30.0180.04512.01
5.4.20.0170.04112.01
5.4.10.0130.04712.01
5.4.00.0160.04511.50
5.3.270.0190.04612.72
5.3.260.0360.09112.72
5.3.250.0110.04912.72
5.3.240.0170.04312.72
5.3.230.0200.04212.71
5.3.220.0170.04512.68
5.3.210.0170.04612.68
5.3.200.0250.06712.68
5.3.190.0190.04412.68
5.3.180.0190.04012.68
5.3.170.0200.04012.67
5.3.160.0160.04612.67
5.3.150.0180.04212.67
5.3.140.0210.04012.66
5.3.130.0180.04512.66
5.3.120.0140.04612.65
5.3.110.0340.08712.66
5.3.100.0220.04012.12
5.3.90.0150.04312.11
5.3.80.0140.04912.09
5.3.70.0200.04012.09
5.3.60.0150.04412.08
5.3.50.0120.05212.03
5.3.40.0300.06112.03
5.3.30.0200.03812.00
5.3.20.0150.04311.77
5.3.10.0200.03711.73
5.3.00.0110.04611.71

preferences:
140.2 ms | 1394 KiB | 7 Q