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(); $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)
8.3.60.0170.00018.55
8.3.50.0090.00922.05
8.3.40.0110.00418.76
8.3.30.0090.00618.72
8.3.20.0080.00018.77
8.3.10.0060.00320.66
8.3.00.0040.00419.30
8.2.180.0140.00716.75
8.2.170.0120.00322.96
8.2.160.0030.01222.26
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00420.02
8.2.110.0040.00720.35
8.2.100.0090.00517.85
8.2.90.0000.00919.34
8.2.80.0060.00317.97
8.2.70.0030.00617.63
8.2.60.0030.00617.93
8.2.50.0040.00418.10
8.2.40.0040.00418.16
8.2.30.0050.00319.79
8.2.20.0040.00417.74
8.2.10.0060.00317.75
8.2.00.0000.00817.71
8.1.280.0070.01125.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.89
8.1.230.0140.00019.09
8.1.220.0080.00017.78
8.1.210.0080.00018.77
8.1.200.0040.00417.23
8.1.190.0090.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00718.75
8.1.160.0040.00418.76
8.1.150.0040.00418.53
8.1.140.0000.00717.36
8.1.130.0030.00317.93
8.1.120.0000.00717.48
8.1.110.0070.00017.40
8.1.100.0040.00417.45
8.1.90.0030.00417.41
8.1.80.0030.00417.34
8.1.70.0030.00317.32
8.1.60.0050.00217.63
8.1.50.0000.00717.51
8.1.40.0040.00417.46
8.1.30.0040.00417.61
8.1.20.0050.00317.72
8.1.10.0000.00717.62
8.1.00.0040.00417.61
8.0.300.0050.00219.65
8.0.290.0060.00316.63
8.0.280.0030.00318.48
8.0.270.0040.00417.25
8.0.260.0060.00016.88
8.0.250.0080.00017.04
8.0.240.0040.00416.85
8.0.230.0070.00016.89
8.0.220.0030.00316.86
8.0.210.0000.00716.76
8.0.200.0030.00316.98
8.0.190.0030.00516.91
8.0.180.0040.00416.86
8.0.170.0000.00816.79
8.0.160.0030.00316.93
8.0.150.0060.00316.81
8.0.140.0050.00216.83
8.0.130.0060.00013.26
8.0.120.0040.00416.86
8.0.110.0000.00816.70
8.0.100.0040.00416.76
8.0.90.0040.00416.96
8.0.80.0110.00416.78
8.0.70.0040.00416.86
8.0.60.0040.00416.88
8.0.50.0000.00816.92
8.0.30.0120.00617.20
8.0.20.0160.00817.40
8.0.10.0000.00816.84
8.0.00.0080.01116.74
7.4.330.0050.00014.64
7.4.320.0030.00316.41
7.4.300.0030.00316.63
7.4.290.0000.00716.52
7.4.280.0020.00516.49
7.4.270.0000.00816.64
7.4.260.0030.00313.31
7.4.250.0040.00416.52
7.4.240.0000.00816.44
7.4.230.0040.00416.44
7.4.220.0040.01516.55
7.4.210.0090.00716.58
7.4.200.0030.00316.67
7.4.190.0040.00416.44
7.4.160.0090.00916.64
7.4.150.0080.00817.40
7.4.140.0080.00917.86
7.4.130.0120.00716.58
7.4.120.0100.00816.48
7.4.110.0090.00916.58
7.4.100.0120.00916.39
7.4.90.0090.00916.33
7.4.80.0070.01019.04
7.4.70.0070.01116.61
7.4.60.0080.00816.44
7.4.50.0040.00416.47
7.4.40.0000.01422.27
7.4.30.0030.01316.61
7.4.00.0090.00615.23
7.3.330.0050.00013.39
7.3.320.0030.00313.31
7.3.310.0040.00416.40
7.3.300.0030.00316.29
7.3.290.0080.00616.40
7.3.280.0080.01016.38
7.3.270.0070.01017.40
7.3.260.0170.00718.24
7.3.250.0140.00816.50
7.3.240.0130.00316.61
7.3.230.0130.00416.63
7.3.210.0090.00916.41
7.3.200.0130.00419.39
7.3.190.0090.01516.72
7.3.180.0060.01316.36
7.3.170.0030.01316.43
7.3.160.0000.01616.35
7.3.120.0110.00317.15
7.3.110.0070.00717.15
7.3.100.0030.00617.15
7.3.90.0100.00317.15
7.3.80.0090.00617.15
7.3.70.0070.00717.15
7.3.60.0100.00317.15
7.3.50.0030.01017.15
7.3.40.0040.01117.15
7.3.30.0130.00317.15
7.3.20.0060.00917.15
7.3.10.0100.00317.15
7.3.00.0000.00917.15
7.2.330.0080.00816.46
7.2.320.0180.00416.47
7.2.310.0140.00516.50
7.2.300.0060.01216.35
7.2.290.0100.00716.74
7.2.240.0100.00317.15
7.2.230.0030.01017.15
7.2.220.0040.01117.15
7.2.210.0100.00717.15
7.2.200.0060.00617.15
7.2.190.0030.01417.15
7.2.180.0030.00917.15
7.2.170.0070.00717.15
7.2.160.0070.00717.15
7.2.150.0000.01217.15
7.2.140.0070.00717.15
7.2.130.0060.01117.15
7.2.120.0060.00917.15
7.2.110.0120.00617.15
7.2.100.0100.00317.15
7.2.90.0090.00917.15
7.2.80.0030.01217.15
7.2.70.0150.00317.15
7.2.60.0050.01017.10
7.2.50.0040.01117.15
7.2.40.0100.00717.15
7.2.30.0070.01117.15
7.2.20.0070.01117.15
7.2.10.0030.01317.15
7.2.00.0030.00918.34
7.1.330.0050.00517.15
7.1.320.0070.00417.15
7.1.310.0090.00617.15
7.1.300.0000.01117.15
7.1.290.0030.00617.15
7.1.280.0000.01117.15
7.1.270.0070.00717.15
7.1.260.0000.01717.15
7.1.250.0100.00317.15
7.1.200.0000.00915.79
7.1.100.0110.00317.98
7.1.70.0070.00317.25
7.1.60.0080.00819.40
7.1.50.0060.01517.00
7.1.00.0070.05322.43
7.0.200.0040.00416.52
7.0.140.0030.05722.09
7.0.60.0170.06720.03
7.0.50.0030.04017.89
7.0.40.0000.05020.18
7.0.30.0300.05020.26
7.0.20.0370.06720.16
7.0.10.0200.04320.02
7.0.00.0030.04320.16
5.6.280.0070.07020.95
5.6.210.0000.07020.73
5.6.200.0070.05018.29
5.6.190.0170.07720.55
5.6.180.0330.07320.45
5.6.170.0200.03720.62
5.6.160.0130.06020.48
5.6.150.0100.08318.18
5.6.140.0100.07718.27
5.6.130.0070.08718.15
5.6.120.0030.08720.98
5.6.110.0130.05320.98
5.6.100.0130.07021.01
5.6.90.0130.07721.00
5.6.80.0030.04020.38
5.6.70.0330.07020.47
5.5.350.3630.03720.33
5.5.340.0070.08317.98
5.5.330.0100.05320.47
5.5.320.0230.04320.57
5.5.310.0300.07720.51
5.5.300.0030.05318.06
5.5.290.0100.07717.96
5.5.280.0070.05320.78
5.5.270.0100.04020.77
5.5.260.0070.05720.77
5.5.250.0030.04020.72
5.5.240.0100.05020.27
5.4.450.0000.04319.20
5.4.440.0000.04719.32
5.4.430.0100.07319.52
5.4.420.0100.08319.61
5.4.410.0070.08019.17
5.4.400.0100.06318.92
5.4.390.0100.04019.24
5.4.380.0070.04318.98
5.4.370.0070.08019.08
5.4.360.0030.05718.86
5.4.350.0030.07018.93
5.4.340.0030.07718.85
5.4.320.0100.07319.24
5.4.310.0100.07719.14
5.4.300.0030.07019.00
5.4.290.0070.03719.11
5.4.280.0070.08019.12
5.4.270.0100.07319.08
5.4.260.0100.04719.24
5.4.250.0030.04718.86
5.4.240.0070.04019.11
5.4.230.0070.04019.25
5.4.220.0100.04718.89
5.4.210.0000.04718.84
5.4.200.0070.03318.92
5.4.190.0030.03719.14
5.4.180.0070.03319.07
5.4.170.0030.04019.19
5.4.160.0000.04018.98
5.4.150.0000.04019.13
5.4.140.0070.04016.48
5.4.130.0030.03316.31
5.4.120.0000.03716.40
5.4.110.0070.06016.44
5.4.100.0000.04016.39
5.4.90.0070.04016.46
5.4.80.0000.03716.50
5.4.70.0000.03716.44
5.4.60.0000.03716.25
5.4.50.0100.03016.40
5.4.40.0000.03716.66
5.4.30.0000.03716.26
5.4.20.0030.03716.46
5.4.10.0030.03316.27
5.4.00.0000.04315.77
5.3.290.0170.06714.73
5.3.280.0070.07014.76
5.3.270.0070.03714.76
5.3.260.0000.04014.67
5.3.250.0100.03014.64
5.3.240.0100.03014.51
5.3.230.0030.03714.61
5.3.220.0070.03314.59
5.3.210.0070.04014.47
5.3.200.0030.04014.63
5.3.190.0030.04714.63
5.3.180.0030.04014.61
5.3.170.0000.03714.62
5.3.160.0000.04014.65
5.3.150.0030.03714.50
5.3.140.0100.03014.59
5.3.130.0100.03014.59
5.3.120.0030.03714.72
5.3.110.0030.03714.63
5.3.100.0030.03714.05
5.3.90.0000.03714.18
5.3.80.0030.04314.02
5.3.70.0000.03714.08
5.3.60.0030.03714.15
5.3.50.0000.03714.00
5.3.40.0000.03713.95
5.3.30.0070.03013.93
5.3.20.0030.03313.71
5.3.10.0030.03313.69
5.3.00.0070.03013.61
5.2.170.0000.03011.21
5.2.160.0000.03011.30
5.2.150.0030.02711.16
5.2.140.0030.03011.30
5.2.130.0030.02711.04
5.2.120.0030.02711.26
5.2.110.0030.02711.17
5.2.100.0000.03011.19
5.2.90.0030.02711.28
5.2.80.0070.02311.20
5.2.70.0030.03711.18
5.2.60.0000.03011.06
5.2.50.0000.03311.04
5.2.40.0000.03010.96
5.2.30.0030.03010.95
5.2.20.0130.05310.96
5.2.10.0030.02710.91
5.2.00.0030.04010.89
5.1.60.0030.05710.16
5.1.50.0070.0539.98
5.1.40.0000.0509.96
5.1.30.0070.05710.50
5.1.20.0100.05310.42
5.1.10.0070.05010.07
5.1.00.0100.02710.05
5.0.50.0030.0308.54
5.0.40.0070.0438.48
5.0.30.0030.0308.39
5.0.20.0070.0178.37
5.0.10.0030.0408.26
5.0.00.0000.0578.26
4.4.90.0000.0178.26
4.4.80.0000.0408.26
4.4.70.0030.0138.26
4.4.60.0070.0308.26
4.4.50.0000.0178.26
4.4.40.0030.0238.26
4.4.30.0000.0308.26
4.4.20.0000.0408.26
4.4.10.0000.0208.26
4.4.00.0070.0408.26
4.3.110.0000.0408.26
4.3.100.0000.0378.26
4.3.90.0030.0178.26
4.3.80.0000.0338.26
4.3.70.0000.0378.26
4.3.60.0030.0308.26
4.3.50.0030.0338.26
4.3.40.0030.0408.26
4.3.30.0030.0338.26
4.3.20.0000.0408.26
4.3.10.0000.0308.26
4.3.00.0070.0178.26

preferences:
49.78 ms | 401 KiB | 5 Q