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; */ 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(); $obj3 = clone $obj; $obj2=new $obj; $obj2->object1 = new SubObject(); $obj2->object2 = new SubObject(); print("Oggetto originale:\n"); print_r($obj); print("Oggetto originale:\n"); print_r($obj2); print("Oggetto clonato:\n"); print_r($obj3); ?>

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.3.60.0100.00718.68
8.3.50.0030.01221.99
8.3.40.0120.00318.84
8.3.30.0000.01418.67
8.3.20.0000.00818.91
8.3.10.0000.00820.57
8.3.00.0040.00419.26
8.2.180.0170.00316.73
8.2.170.0090.00622.96
8.2.160.0070.00722.08
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0100.00021.01
8.2.100.0040.00817.91
8.2.90.0000.00819.18
8.2.80.0040.00418.05
8.2.70.0000.00817.50
8.2.60.0030.00517.93
8.2.50.0030.00518.07
8.2.40.0030.00618.28
8.2.30.0000.00819.83
8.2.20.0000.00817.74
8.2.10.0080.00017.72
8.2.00.0040.00417.69
8.1.280.0100.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00320.81
8.1.230.0000.01120.98
8.1.220.0080.00018.77
8.1.210.0030.00518.87
8.1.200.0000.01117.36
8.1.190.0080.00017.50
8.1.180.0070.00018.10
8.1.170.0060.00318.84
8.1.160.0040.00418.89
8.1.150.0040.00418.53
8.1.140.0040.00417.42
8.1.130.0000.00717.86
8.1.120.0000.00717.48
8.1.110.0000.00717.46
8.1.100.0000.00717.45
8.1.90.0000.00717.42
8.1.80.0040.00417.43
8.1.70.0000.00817.31
8.1.60.0000.00717.57
8.1.50.0000.00817.42
8.1.40.0040.00417.45
8.1.30.0020.00517.62
8.1.20.0030.00517.70
8.1.10.0000.00817.61
8.1.00.0040.00417.46
8.0.300.0100.00019.87
8.0.290.0040.00416.75
8.0.280.0040.00418.39
8.0.270.0000.00717.42
8.0.260.0000.00716.84
8.0.250.0040.00416.86
8.0.240.0060.00316.94
8.0.230.0000.00916.94
8.0.220.0030.00316.84
8.0.210.0050.00316.88
8.0.200.0050.00316.79
8.0.190.0030.00416.82
8.0.180.0040.00416.88
8.0.170.0060.00316.87
8.0.160.0050.00216.79
8.0.150.0000.00916.86
8.0.140.0030.00716.78
8.0.130.0030.00313.29
8.0.120.0040.00416.84
8.0.110.0040.00416.88
8.0.100.0030.00516.82
8.0.90.0000.00716.83
8.0.80.0120.00316.92
8.0.70.0000.00716.75
8.0.60.0040.00416.75
8.0.50.0040.00416.74
8.0.30.0130.00617.04
8.0.20.0100.00917.44
8.0.10.0040.00417.05
8.0.00.0140.00416.83
7.4.330.0030.00314.59
7.4.320.0030.00316.59
7.4.300.0000.00616.48
7.4.290.0000.00716.52
7.4.280.0000.00716.44
7.4.270.0000.00716.52
7.4.260.0000.00513.30
7.4.250.0040.00416.61
7.4.240.0030.00316.67
7.4.230.0080.00016.65
7.4.220.0090.00916.49
7.4.210.0090.00716.50
7.4.200.0000.00716.67
7.4.190.0000.00816.47
7.4.160.0060.01016.73
7.4.150.0110.00617.40
7.4.140.0080.00817.86
7.4.130.0120.00616.38
7.4.120.0120.00516.54
7.4.110.0030.01316.46
7.4.100.0070.01116.49
7.4.90.0130.00316.53
7.4.80.0110.00619.04
7.4.70.0130.00316.52
7.4.60.0100.00616.54
7.4.50.0020.00216.29
7.4.40.0110.00422.27
7.4.30.0090.00916.52
7.4.00.0100.00715.15
7.3.330.0000.00513.38
7.3.320.0000.00513.34
7.3.310.0000.00716.40
7.3.300.0050.00216.38
7.3.290.0040.01516.40
7.3.280.0090.00616.34
7.3.270.0110.00717.40
7.3.260.0130.00618.24
7.3.250.0100.00716.47
7.3.240.0120.00316.63
7.3.230.0090.00916.39
7.3.210.0110.00716.30
7.3.200.0030.01419.39
7.3.190.0130.00316.59
7.3.180.0100.01016.29
7.3.170.0130.01016.50
7.3.160.0120.00316.45
7.3.120.0100.00314.89
7.2.330.0060.01416.30
7.2.320.0100.01416.75
7.2.310.0100.01016.57
7.2.300.0030.01316.66
7.2.290.0040.01216.73
7.2.60.0080.00317.04
7.2.00.0040.01219.53
7.1.200.0030.01015.57
7.1.100.0000.01118.27
7.1.70.0000.00817.16
7.1.60.0140.01019.40
7.1.50.0160.00016.95
7.1.00.0100.06722.54
7.0.200.0000.00916.69
7.0.140.0000.07722.09
7.0.60.0070.06320.01
7.0.50.0100.05717.87
7.0.40.0100.08320.09
7.0.30.0270.05320.24
7.0.20.0330.07720.08
7.0.10.0170.07320.07
7.0.00.0200.07020.05
5.6.280.0070.07021.06
5.6.210.0030.04020.63
5.6.200.0130.07318.16
5.6.190.0000.06020.42
5.6.180.0570.06720.57
5.6.170.0300.08020.52
5.6.160.0100.08020.44
5.6.150.0130.03018.23
5.6.140.0130.07318.15
5.6.130.0030.04318.11
5.6.120.0100.05320.94
5.6.110.0070.08320.96
5.6.100.0170.08321.14
5.6.90.0070.05720.98
5.6.80.0030.04020.45
5.5.350.0330.06320.42
5.5.340.0070.05717.98
5.5.330.0100.08720.37
5.5.320.0270.05720.25
5.5.310.0300.07720.24
5.5.300.0030.04017.98
5.5.290.0070.06717.96
5.5.280.0030.07320.80
5.5.270.0070.08320.67
5.5.260.0130.06320.87
5.5.250.0000.06020.70
5.5.240.0200.07020.30
5.4.450.0030.04319.57
5.4.440.0100.05019.48
5.4.430.0100.08019.48
5.4.420.0130.06719.58
5.4.410.0100.03319.35
5.4.400.0070.06719.14
5.4.390.0000.08719.08
5.4.380.0100.07319.14
5.4.370.0070.07719.12
5.4.360.0030.05018.98
5.4.350.0100.06019.21
5.4.340.0030.05018.86
5.4.320.0100.08018.87
5.4.310.0170.05718.87
5.4.300.0070.06319.16
5.4.290.0070.04318.88
5.4.280.0000.04318.84
5.4.270.0030.04019.14
5.4.260.0030.04018.85
5.4.250.0100.05018.84
5.4.240.0000.04719.16
5.4.230.0070.03719.13
5.4.220.0100.03719.20
5.4.210.0030.04019.25
5.4.200.0030.04019.11
5.4.190.0070.07019.19
5.4.180.0030.08019.20
5.4.170.0030.08018.84
5.4.160.0070.06719.13
5.4.150.0100.03719.18
5.4.140.0100.07016.43
5.4.130.0100.03016.42
5.4.120.0100.06716.54
5.4.110.0100.03716.36
5.4.100.0070.05016.48
5.4.90.0030.05316.58
5.4.80.0070.06716.46
5.4.70.0070.05316.34
5.4.60.0170.06016.27
5.4.50.0130.06716.39
5.4.40.0070.07316.27
5.4.30.0000.05716.30
5.4.20.0170.03316.38
5.4.10.0100.07016.47
5.4.00.0030.07715.84
5.3.290.0070.04014.72
5.3.280.0070.05014.64
5.3.270.0070.07014.50
5.3.260.0070.08014.65
5.3.250.0070.07714.68
5.3.240.0130.07014.54
5.3.230.0130.05714.66
5.3.220.0000.04014.74
5.3.210.0000.05714.67
5.3.200.0130.06714.59
5.3.190.0000.04314.59
5.3.180.0030.04014.58
5.3.170.0070.06714.63
5.3.160.0030.07714.46
5.3.150.0100.07014.57
5.3.140.0070.07014.58
5.3.130.0070.06314.60
5.3.120.0070.08714.58
5.3.110.0100.07014.62
5.3.100.0070.05014.04
5.3.90.0070.07014.02
5.3.80.0070.05314.04
5.3.70.0130.04714.03
5.3.60.0070.04713.93
5.3.50.0070.07014.00
5.3.40.0030.05013.95
5.3.30.0000.05313.80
5.3.20.0130.04313.84
5.3.10.0070.06313.60
5.3.00.0000.05013.69
5.2.170.0030.03711.23
5.2.160.0030.03311.23
5.2.150.0130.05711.21
5.2.140.0030.04311.11
5.2.130.0130.04711.08
5.2.120.0070.06311.03
5.2.110.0130.05011.27
5.2.100.0030.03311.17
5.2.90.0000.04011.11
5.2.80.0030.03011.11
5.2.70.0030.06711.05
5.2.60.0070.03711.22
5.2.50.0030.03311.05
5.2.40.0000.03311.02
5.2.30.0100.05711.00
5.2.20.0030.06011.01
5.2.10.0170.05010.87
5.2.00.0030.06310.76
5.1.60.0030.0309.91
5.1.50.0030.05710.14
5.1.40.0070.04010.01
5.1.30.0070.03710.36
5.1.20.0130.02710.36
5.1.10.0070.05710.04
5.1.00.0070.05710.03
5.0.50.0000.0438.71
5.0.40.0130.0308.48
5.0.30.0070.0608.30
5.0.20.0100.0408.23
5.0.10.0030.0308.18
5.0.00.0000.0538.08
4.4.90.0070.0237.88
4.4.80.0000.0177.88
4.4.70.0030.0337.88
4.4.60.0100.0307.88
4.4.50.0000.0377.88
4.4.40.0030.0507.88
4.4.30.0070.0237.88
4.4.20.0000.0207.88
4.4.10.0130.0277.88
4.4.00.0030.0537.88
4.3.110.0000.0277.88
4.3.100.0000.0377.88
4.3.90.0000.0237.88
4.3.80.0000.0307.88
4.3.70.0000.0377.88
4.3.60.0070.0237.88
4.3.50.0000.0237.88
4.3.40.0000.0577.88
4.3.30.0030.0377.88
4.3.20.0000.0377.88
4.3.10.0000.0377.88
4.3.00.0030.0307.88

preferences:
46.59 ms | 401 KiB | 5 Q