3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SubObject { static $instances = 0; public $instance; public function __construct() { $this->instance = ++self::$instances; } public function __clone() { $this->instance = ++self::$instances; } } 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; } } $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)
8.3.60.0140.00718.27
8.3.50.0110.00416.37
8.3.40.0110.00418.66
8.3.30.0180.00419.17
8.3.20.0040.00420.34
8.3.10.0080.00023.69
8.3.00.0040.00419.16
8.2.180.0090.00616.47
8.2.170.0140.00322.96
8.2.160.0070.00719.16
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00021.97
8.2.110.0060.00320.98
8.2.100.0060.00617.75
8.2.90.0050.00319.17
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0050.00318.34
8.2.30.0050.00818.82
8.2.20.0050.00317.70
8.2.10.0060.00318.09
8.2.00.0040.00417.60
8.1.270.0040.00424.02
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00024.02
8.1.230.0110.00019.07
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0090.00017.23
8.1.190.0000.00817.23
8.1.180.0030.00618.10
8.1.170.0050.00320.25
8.1.160.0050.00321.93
8.1.150.0040.00418.71
8.1.140.0000.00717.29
8.1.130.0040.00417.77
8.1.120.0080.00017.32
8.1.110.0000.00817.43
8.1.100.0020.00517.36
8.1.90.0050.00217.34
8.1.80.0040.00417.42
8.1.70.0000.00717.40
8.1.60.0090.00117.53
8.1.50.0040.00417.54
8.1.40.0010.00717.48
8.1.30.0010.00717.61
8.1.20.0040.00417.63
8.1.10.0030.00517.54
8.1.00.0060.00117.39
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0000.00717.29
8.0.260.0030.00318.44
8.0.250.0000.00716.78
8.0.240.0000.00716.87
8.0.230.0060.00116.83
8.0.220.0050.00216.86
8.0.210.0030.00316.80
8.0.200.0050.00216.82
8.0.190.0040.00416.86
8.0.180.0040.00416.83
8.0.170.0070.00016.83
8.0.160.0050.00216.87
8.0.150.0000.00716.76
8.0.140.0050.00216.75
8.0.130.0060.00014.97
8.0.120.0030.00416.74
8.0.110.0080.00016.76
8.0.100.0060.00116.83
8.0.90.0020.00516.79
8.0.80.0030.00616.84
8.0.70.0020.00616.72
8.0.60.0030.00416.79
8.0.50.0030.00516.76
8.0.30.0050.00616.84
8.0.20.0050.00617.00
8.0.10.0030.00516.88
8.0.00.0060.00516.90
7.4.330.0080.00015.02
7.4.320.0060.00016.36
7.4.300.0040.00316.52
7.4.290.0040.00416.60
7.4.280.0040.00416.50
7.4.270.0020.00516.50
7.4.260.0010.00616.47
7.4.250.0040.00416.60
7.4.240.0020.00516.55
7.4.230.0030.00416.53
7.4.220.0040.00516.55
7.4.210.0040.00416.58
7.4.200.0040.00316.56
7.4.190.0020.00516.63
7.4.180.0040.00316.57
7.4.160.0010.00716.58
7.4.150.0040.00516.72
7.4.140.0060.00416.89
7.4.130.0040.00816.44
7.4.120.0050.00516.44
7.4.110.0070.00416.49
7.4.100.0040.00616.50
7.4.90.0050.00616.45
7.4.80.0040.00616.90
7.4.70.0040.00716.47
7.4.60.0050.00516.49
7.4.50.0030.00616.37
7.4.40.0060.00516.37
7.4.30.0040.00616.45
7.4.20.0030.00616.44
7.4.10.0040.00716.20
7.4.00.0030.00816.09
7.3.330.0060.00314.75
7.3.320.0040.00514.59
7.3.310.0050.00616.18
7.3.300.0050.00416.21
7.3.290.0050.00616.28
7.3.280.0070.00516.28
7.3.270.0050.00716.42
7.3.260.0060.00516.34
7.3.250.0050.00616.35
7.3.240.0040.00716.29
7.3.230.0080.00516.31
7.3.220.0080.00416.23
7.3.210.0070.00516.29
7.3.200.0070.00416.65
7.3.190.0060.00516.29
7.3.180.0060.00516.28
7.3.170.0070.00516.34
7.3.160.0080.00416.24
7.3.150.0060.00416.30
7.3.140.0040.00716.24
7.3.130.0080.00416.09
7.3.120.0050.00716.09
7.3.110.0060.00616.01
7.3.100.0080.00415.79
7.3.90.0060.00516.01
7.3.80.0070.00715.71
7.3.70.0060.00615.75
7.3.60.0060.00715.64
7.3.50.0070.00715.63
7.3.40.0060.00615.62
7.3.30.0090.00515.59
7.3.20.0080.00616.03
7.3.10.0080.00716.06
7.3.00.0110.00715.91
7.2.340.0060.00616.38
7.2.330.0050.00716.45
7.2.320.0060.00616.46
7.2.310.0080.00516.44
7.2.300.0060.00616.46
7.2.290.0050.00816.48
7.2.280.0060.00616.38
7.2.270.0050.00716.35
7.2.260.0050.00716.22
7.2.250.0080.00616.18
7.2.240.0060.00616.22
7.2.230.0060.00716.00
7.2.220.0070.00616.01
7.2.210.0080.00615.90
7.2.200.0090.00515.96
7.2.190.0080.00715.76
7.2.180.0070.00615.75
7.2.170.0060.00615.78
7.2.160.0110.00515.79
7.2.150.0080.00716.25
7.2.140.0080.00616.21
7.2.130.0130.00616.18
7.2.120.0130.00616.15
7.2.110.0150.00616.08
7.2.100.0090.00816.11
7.2.90.0110.00816.17
7.2.80.0110.00716.17
7.2.70.0110.00716.23
7.2.60.0090.00716.20
7.2.50.0130.00716.13
7.2.40.0130.00716.17
7.2.30.0120.00616.18
7.2.20.0100.00716.06
7.2.10.0120.00916.13
7.2.00.0140.00716.18
7.1.330.0180.00415.55
7.1.320.0120.00615.38
7.1.310.0090.00615.14
7.1.300.0080.00715.04
7.1.290.0100.00615.07
7.1.280.0080.00715.08
7.1.270.0070.00815.08
7.1.260.0280.00515.06
7.1.250.0150.00414.94
7.1.240.0140.00715.00
7.1.230.0120.00815.03
7.1.220.0160.00714.95
7.1.210.0140.00714.96
7.1.200.0120.00715.05
7.1.190.0120.00714.94
7.1.180.0140.00714.94
7.1.170.0140.00714.94
7.1.160.0140.00714.93
7.1.150.0130.00615.00
7.1.140.0130.00814.94
7.1.130.0130.00714.98
7.1.120.0160.00614.95
7.1.110.0230.00715.01
7.1.100.0110.00614.97
7.1.90.0110.00714.92
7.1.80.0280.00714.95
7.1.70.0130.00615.03
7.1.60.0130.00915.34
7.1.50.0140.00716.52
7.1.40.0110.00714.91
7.1.30.0130.00514.95
7.1.20.0120.00714.94
7.1.10.0330.00715.00
7.1.00.0120.01215.52
7.0.330.0170.00614.56
7.0.320.0170.00514.63
7.0.310.0190.00614.62
7.0.300.0160.00514.60
7.0.290.0130.00814.55
7.0.280.0170.00514.59
7.0.270.0150.00514.59
7.0.260.0150.00514.61
7.0.250.0150.00514.73
7.0.240.0160.00614.70
7.0.230.0140.00614.68
7.0.220.0130.00614.72
7.0.210.0150.00614.66
7.0.200.0170.00714.67
7.0.190.0150.00514.64
7.0.180.0130.00614.67
7.0.170.0140.00514.71
7.0.160.0150.00514.62
7.0.150.0130.00614.64
7.0.140.0110.01315.26
7.0.130.0120.00714.65
7.0.120.0120.00714.65
7.0.110.0140.00614.60
7.0.100.0150.00614.66
7.0.90.0140.00714.59
7.0.80.0120.00815.06
7.0.70.0150.01015.08
7.0.60.0140.00915.05
7.0.50.0120.01115.08
7.0.40.0130.01115.13
7.0.30.0150.00815.16
7.0.20.0130.01115.08
7.0.10.0130.00815.13
7.0.00.0120.00815.11
5.6.400.0100.00715.25
5.6.390.0100.00615.22
5.6.380.0080.00715.12
5.6.370.0130.00515.20
5.6.360.0110.00615.24
5.6.350.0110.00715.24
5.6.340.0100.00615.20
5.6.330.0100.00715.15
5.6.320.0090.00815.19
5.6.310.0090.00815.26
5.6.300.0090.00715.03
5.6.290.0110.00715.09
5.6.280.0080.01415.67
5.6.270.0110.01115.15
5.6.260.0120.00815.11
5.6.250.0110.00715.18
5.6.240.0110.00715.13
5.6.230.0100.00915.66
5.6.220.0090.01015.66
5.6.210.0100.00915.61
5.6.200.0110.01015.72
5.6.190.0110.00815.69
5.6.180.0100.01015.62
5.6.170.0090.01215.68
5.6.160.0080.01015.59
5.6.150.0090.01015.70
5.6.140.0090.01115.69
5.6.130.0100.01015.66
5.6.120.0100.01115.69
5.6.110.0100.01315.61
5.6.100.0090.01415.63
5.6.90.0100.01015.68
5.6.80.0100.01015.64
5.6.70.0100.01015.55
5.6.60.0100.01415.63
5.6.50.0080.01415.53
5.6.40.0100.01015.50
5.6.30.0100.01315.56
5.6.20.0090.01315.54
5.6.10.0110.01115.48
5.6.00.0090.01415.53
5.5.380.0110.00614.92
5.5.370.0100.01115.37
5.5.360.0110.00915.31
5.5.350.0100.01115.30
5.5.340.0090.00915.22
5.5.330.0110.00915.37
5.5.320.0100.01015.34
5.5.310.0100.01115.26
5.5.300.0100.00915.32
5.5.290.0100.01215.31
5.5.280.0120.01215.29
5.5.270.0110.01215.35
5.5.260.0080.01115.24
5.5.250.0110.01015.25
5.5.240.0090.01315.29
5.5.230.0130.00915.21
5.5.220.0100.01215.26
5.5.210.0070.01315.31
5.5.200.0110.01215.20
5.5.190.0090.01215.21
5.5.180.0100.01215.21
5.5.170.0110.00715.06
5.5.160.0110.01115.17
5.5.150.0090.01415.20
5.5.140.0120.01015.05
5.5.130.0120.01115.08
5.5.120.0090.01315.14
5.5.110.0110.01215.15
5.5.100.0110.01115.21
5.5.90.0090.01215.23
5.5.80.0090.01315.25
5.5.70.0120.01015.19
5.5.60.0100.01215.22
5.5.50.0080.01415.12
5.5.40.0110.01215.25
5.5.30.0090.01015.24
5.5.20.0100.01315.13
5.5.10.0090.01215.18
5.5.00.0090.01115.16
5.4.450.0100.01012.58
5.4.440.0090.01112.59
5.4.430.0070.01012.61
5.4.420.0080.01012.55
5.4.410.0080.01012.57
5.4.400.0070.01012.50
5.4.390.0080.00912.48
5.4.380.0070.01112.58
5.4.370.0080.00812.47
5.4.360.0080.01012.48
5.4.350.0090.00612.51
5.4.340.0090.01012.52
5.4.330.0080.00411.95
5.4.320.0090.01112.54
5.4.310.0080.01012.54
5.4.300.0070.01212.53
5.4.290.0080.01212.48
5.4.280.0070.01312.46
5.4.270.0090.00912.52
5.4.260.0080.00912.49
5.4.250.0090.00812.52
5.4.240.0070.01212.55
5.4.230.0100.00912.36
5.4.220.0070.00912.38
5.4.210.0070.01112.47
5.4.200.0080.00912.44
5.4.190.0080.01012.33
5.4.180.0090.01112.35
5.4.170.0110.00912.43
5.4.160.0090.01112.41
5.4.150.0070.01112.40
5.4.140.0100.00812.28
5.4.130.0070.01112.31
5.4.120.0080.00812.34
5.4.110.0080.01012.35
5.4.100.0070.01212.35
5.4.90.0100.00812.34
5.4.80.0070.01212.38
5.4.70.0090.01112.31
5.4.60.0090.00712.37
5.4.50.0080.00812.34
5.4.40.0080.01012.27
5.4.30.0070.00812.31
5.4.20.0080.01212.36
5.4.10.0090.00912.33
5.4.00.0080.01112.22

preferences:
43.52 ms | 400 KiB | 5 Q