3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace test { class SubObject { static $instances = 0; public $instance; public function __construct() { $this->instance = ++self::$instances; } public function __clone() { $this->instance = ++self::$instances; } } } namespace test1 { class MyCloneable { public $object1; public $object2; function __clone() { // Force a copy of this->object, otherwise // it will point to same object. $this->object1 = clone $this->object1; } } } namesapce test3 { $obj = new MyCloneable(); $obj->object1 = new SubObject(); $obj->object2 = new SubObject(); $obj2 = clone $obj; print("Original Object:\n"); print_r($obj); print("Cloned Object:\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.4.340.0270.06718.99
5.4.320.0330.06719.09
5.4.310.0370.06719.15
5.4.300.0330.06018.98
5.4.290.0330.06019.24
5.4.280.0330.07019.22
5.4.270.0270.04718.98
5.4.260.0170.05018.88
5.4.250.0430.03719.15
5.4.240.0300.07319.21
5.4.230.0300.05719.05
5.4.220.0270.05719.00
5.4.210.0230.05019.07
5.4.200.0400.07019.15
5.4.190.0330.06019.05
5.4.180.0230.07719.19
5.4.170.0300.07019.05
5.4.160.0230.05018.97
5.4.150.0230.04718.85
5.4.140.0330.07016.38
5.4.130.0370.05716.72
5.4.120.0270.03316.42
5.4.110.0200.04316.50
5.4.100.0230.04316.63
5.4.90.0300.07016.61
5.4.80.0330.06716.59
5.4.70.0370.05316.60
5.4.60.0270.05316.49
5.4.50.0230.05016.51
5.4.40.0270.04016.43
5.4.30.0330.06316.52
5.4.20.0200.03716.55
5.4.10.0370.03316.42
5.4.00.0200.04715.80
5.3.290.0230.08014.65
5.3.280.0370.07014.76
5.3.270.0400.06014.59
5.3.260.0270.05014.61
5.3.250.0300.05314.62
5.3.240.0230.04714.53
5.3.230.0270.04714.61
5.3.220.0230.03714.47
5.3.210.0330.06014.55
5.3.200.0200.06714.49
5.3.190.0300.06314.47
5.3.180.0270.07714.49
5.3.170.0300.06314.48
5.3.160.0230.04014.62
5.3.150.0270.06014.79
5.3.140.0230.06314.58
5.3.130.0270.07714.53
5.3.120.0270.03714.51
5.3.110.0270.05714.53
5.3.100.0230.05713.95
5.3.90.0400.06713.94
5.3.80.0270.07313.93
5.3.70.0300.04314.18
5.3.60.0300.04013.93
5.3.50.0300.03013.95
5.3.40.0330.04714.04
5.3.30.0270.07013.82
5.3.20.0270.03713.67
5.3.10.0330.06313.67
5.3.00.0270.07013.56
5.2.170.0200.04012.11
5.2.160.0230.04312.11
5.2.150.0270.04312.11
5.2.140.0230.03712.11
5.2.130.0270.05312.11
5.2.120.0270.05312.11
5.2.110.0200.05712.11
5.2.100.0230.06312.11
5.2.90.0230.05712.11
5.2.80.0270.03312.11
5.2.70.0230.04712.11
5.2.60.0270.05712.11
5.2.50.0270.05712.11
5.2.40.0230.04712.11
5.2.30.0230.05312.11
5.2.20.0230.04012.11
5.2.10.0300.05012.11
5.2.00.0200.04712.11
5.1.60.0230.04712.11
5.1.50.0230.04712.11
5.1.40.0200.04712.11
5.1.30.0200.05012.11
5.1.20.0230.05312.11
5.1.10.0200.05312.11
5.1.00.0170.04312.11
5.0.50.0130.04312.11
5.0.40.0100.03312.11
5.0.30.0170.04712.11
5.0.20.0130.03712.11
5.0.10.0130.04312.11
5.0.00.0200.05712.11
4.4.90.0070.02012.11
4.4.80.0070.02712.11
4.4.70.0100.03312.11
4.4.60.0130.02312.11
4.4.50.0200.02312.11
4.4.40.0170.02312.11
4.4.30.0100.03312.11
4.4.20.0130.03312.11
4.4.10.0100.02312.11
4.4.00.0130.05012.11
4.3.110.0170.03012.11
4.3.100.0100.03012.11
4.3.90.0130.02312.11
4.3.80.0070.05312.11
4.3.70.0100.01712.11
4.3.60.0070.03712.11
4.3.50.0070.02012.11
4.3.40.0100.03012.11
4.3.30.0030.02312.11
4.3.20.0000.03012.11
4.3.10.0030.03312.11
4.3.00.0030.02712.11

preferences:
144.54 ms | 1394 KiB | 7 Q