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; echo 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.0120.00616.72
8.3.50.0120.00622.02
8.3.40.0040.01118.79
8.3.30.0090.00918.63
8.3.20.0080.00018.90
8.3.10.0060.00320.48
8.3.00.0050.00321.86
8.2.180.0090.00616.63
8.2.170.0000.01422.96
8.2.160.0100.00320.35
8.2.150.0000.00824.18
8.2.140.0050.00224.66
8.2.130.0080.00026.16
8.2.120.0080.00019.38
8.2.110.0030.00722.25
8.2.100.0110.00017.84
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0060.00318.16
8.2.30.0040.00419.95
8.2.20.0040.00417.72
8.2.10.0040.00417.71
8.2.00.0000.00717.74
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00322.43
8.1.230.0080.00320.96
8.1.220.0060.00318.77
8.1.210.0030.00518.91
8.1.200.0060.00317.35
8.1.190.0040.00417.39
8.1.180.0000.00818.10
8.1.170.0040.00418.26
8.1.160.0050.00218.85
8.1.150.0030.00518.61
8.1.140.0050.00317.33
8.1.130.0000.00817.74
8.1.120.0070.00017.47
8.1.110.0000.00817.43
8.1.100.0040.00417.49
8.1.90.0040.00417.48
8.1.80.0040.00417.47
8.1.70.0040.00417.34
8.1.60.0030.00517.51
8.1.50.0040.00417.40
8.1.40.0030.00617.43
8.1.30.0000.00717.63
8.1.20.0000.00917.54
8.1.10.0040.00417.59
8.1.00.0030.00617.54
8.0.300.0030.00519.98
8.0.290.0000.00816.75
8.0.280.0030.00318.34
8.0.270.0030.00517.27
8.0.260.0000.00616.92
8.0.250.0000.00716.88
8.0.240.0040.00416.98
8.0.230.0030.00316.91
8.0.220.0000.00716.71
8.0.210.0040.00416.92
8.0.200.0040.00416.93
8.0.190.0070.00016.88
8.0.180.0070.00016.89
8.0.170.0000.00716.86
8.0.160.0040.00316.92
8.0.150.0000.00916.93
8.0.140.0030.00616.76
8.0.130.0000.00513.32
8.0.120.0000.00716.84
8.0.110.0040.00416.74
8.0.100.0050.00316.91
8.0.90.0030.00416.87
8.0.80.0130.00316.89
8.0.70.0000.00716.86
8.0.60.0070.00016.77
8.0.50.0030.00516.89
8.0.30.0120.00617.03
8.0.20.0100.00817.40
8.0.10.0000.00717.01
8.0.00.0070.01416.85
7.4.330.0030.00414.64
7.4.320.0030.00316.48
7.4.300.0030.00316.53
7.4.290.0030.00316.61
7.4.280.0030.00616.58
7.4.270.0030.00316.51
7.4.260.0050.00013.32
7.4.250.0000.00816.58
7.4.240.0070.00016.56
7.4.230.0000.00716.73
7.4.220.0180.00616.62
7.4.210.0050.00916.59
7.4.200.0040.00416.33
7.4.190.0040.00416.69
7.4.160.0100.00516.36
7.4.150.0120.00617.40
7.4.140.0070.01117.86
7.4.130.0100.01016.48
7.4.120.0120.01016.54
7.4.110.0070.01116.74
7.4.100.0060.01216.41
7.4.90.0040.01416.57
7.4.80.0040.01519.04
7.4.70.0100.00716.34
7.4.60.0090.01016.57
7.4.50.0040.00416.27
7.4.40.0090.00922.27
7.4.30.0100.00716.68
7.4.00.0060.01014.67
7.3.330.0000.00513.39
7.3.320.0030.00313.21
7.3.310.0000.00716.21
7.3.300.0030.00316.39
7.3.290.0070.00716.44
7.3.280.0080.00816.39
7.3.270.0120.00617.40
7.3.260.0100.01218.24
7.3.250.0110.00716.41
7.3.240.0100.00716.66
7.3.230.0140.00316.39
7.3.210.0080.00916.31
7.3.200.0120.00619.39
7.3.190.0040.01216.50
7.3.180.0080.00816.27
7.3.170.0110.00516.52
7.3.160.0060.01016.58
7.3.120.0070.01014.67
7.3.10.0080.00416.43
7.3.00.0000.01216.65
7.2.330.0030.01316.74
7.2.320.0030.01416.76
7.2.310.0100.01016.77
7.2.300.0070.01416.32
7.2.290.0060.01016.43
7.2.130.0030.00616.89
7.2.120.0100.00316.90
7.2.110.0030.00616.91
7.2.100.0040.00817.10
7.2.90.0090.00616.91
7.2.80.0060.00616.77
7.2.70.0000.01417.05
7.2.60.0030.01016.99
7.2.50.0110.00017.16
7.2.40.0060.00616.83
7.2.30.0070.00716.99
7.2.20.0030.00916.91
7.2.10.0030.00817.14
7.2.00.0060.00818.30
7.1.250.0030.01315.62
7.1.200.0040.01215.54
7.1.100.0030.00818.21
7.1.70.0030.00616.87
7.1.60.0100.01419.40
7.1.50.0140.00016.96
7.1.00.0000.04022.35
7.0.200.0030.00516.76
7.0.140.0070.07021.94
7.0.60.0070.06719.96
7.0.50.0130.07317.90
7.0.40.0070.04717.91
7.0.30.0130.07717.75
7.0.20.0070.04717.75
7.0.10.0100.03717.72
7.0.00.0100.08317.72
5.6.280.0030.07721.04
5.6.210.0030.05720.77
5.6.200.0130.06018.29
5.6.190.0070.08318.21
5.6.180.0130.07018.16
5.6.170.0100.05318.18
5.6.160.0130.07318.28
5.6.150.0070.07018.18
5.6.140.0100.05018.28
5.6.130.0130.03718.18
5.6.120.0130.07318.27
5.6.110.0000.06318.21
5.6.100.0030.07718.13
5.6.90.0000.08718.25
5.6.80.0130.07317.66
5.6.70.0100.07317.53
5.6.60.0100.07717.54
5.6.50.0070.07717.54
5.6.40.0030.07017.51
5.6.30.0030.08017.48
5.6.20.0030.04717.57
5.6.10.0170.04317.62
5.6.00.0070.05317.55
5.5.350.0200.07320.33
5.5.340.0070.07017.99
5.5.330.0000.04317.95
5.5.320.0070.07318.07
5.5.310.0100.07717.95
5.5.300.0030.08718.08
5.5.290.0030.06018.03
5.5.280.0130.08017.95
5.5.270.0070.08018.07
5.5.260.0170.07318.05
5.5.250.0070.08017.85
5.5.240.0030.08017.35
5.5.230.0000.07717.41
5.5.220.0030.06717.32
5.5.210.0100.06717.41
5.5.200.0030.08317.34
5.5.190.0130.06317.34
5.5.180.0130.07317.41
5.5.160.0100.06717.38
5.5.150.0170.03017.29
5.5.140.0100.06717.31
5.5.130.0130.06017.34
5.5.120.0070.07717.30
5.5.110.0000.05317.42
5.5.100.0100.06317.20
5.5.90.0100.05717.23
5.5.80.0070.04017.17
5.5.70.0070.06017.27
5.5.60.0070.06717.20
5.5.50.0130.04317.23
5.5.40.0000.08017.30
5.5.30.0070.04017.30
5.5.20.0130.03017.35
5.5.10.0100.07717.23
5.5.00.0070.07317.30
5.4.450.0130.05319.30
5.4.440.0070.05319.38
5.4.430.0030.07319.27
5.4.420.0130.04719.36
5.4.410.0030.06719.29
5.4.400.0000.06719.02
5.4.390.0130.07319.05
5.4.380.0100.03319.14
5.4.370.0130.07319.27
5.4.360.0100.07719.14
5.4.350.0100.06719.05
5.4.340.0130.06718.89
5.4.320.0070.04019.05
5.4.310.0030.07719.27
5.4.300.0200.04019.04
5.4.290.0100.07319.03
5.4.280.0070.05019.12
5.4.270.0030.04319.01
5.4.260.0030.08018.98
5.4.250.0030.04719.02
5.4.240.0030.04319.08
5.4.230.0000.04019.02
5.4.220.0070.07019.02
5.4.210.0100.07719.02
5.4.200.0030.05318.99
5.4.190.0070.07318.95
5.4.180.0070.08018.95
5.4.170.0070.08018.88
5.4.160.0030.05319.03
5.4.150.0070.08319.10
5.4.140.0100.04716.59
5.4.130.0100.07016.51
5.4.120.0030.07016.34
5.4.110.0070.03316.46
5.4.100.0070.07316.29
5.4.90.0100.07316.37
5.4.80.0070.06316.63
5.4.70.0070.04016.35
5.4.60.0170.05016.21
5.4.50.0070.04316.34
5.4.40.0030.07716.38
5.4.30.0100.06016.56
5.4.20.0030.08016.27
5.4.10.0030.04016.42
5.4.00.0030.07315.98
5.3.290.0070.08014.63
5.3.280.0070.04314.57
5.3.270.0030.07014.64
5.3.260.0130.07314.65
5.3.250.0100.07014.46
5.3.240.0030.06014.67
5.3.230.0070.03714.82
5.3.220.0070.06314.58
5.3.210.0070.04314.61
5.3.200.0030.03714.63
5.3.190.0070.03714.56
5.3.180.0070.07014.53
5.3.170.0100.07314.63
5.3.160.0130.05014.56
5.3.150.0130.03014.62
5.3.140.0100.07314.56
5.3.130.0100.05314.52
5.3.120.0030.06314.60
5.3.110.0100.07714.54
5.3.100.0070.07314.11
5.3.90.0100.07714.03
5.3.80.0100.04014.04
5.3.70.0170.06314.08
5.3.60.0100.04013.86
5.3.50.0030.07714.03
5.3.40.0070.07713.85
5.3.30.0070.07313.82
5.3.20.0030.07713.75
5.3.10.0030.05013.87
5.3.00.0070.07013.67
5.2.170.0100.04311.14
5.2.160.0070.03311.36
5.2.150.0200.04711.37
5.2.140.0030.04711.20
5.2.130.0070.06311.11
5.2.120.0100.04711.01
5.2.110.0030.03311.15
5.2.100.0100.04011.16
5.2.90.0100.03011.00
5.2.80.0070.05311.17
5.2.70.0070.04711.12
5.2.60.0100.06011.14
5.2.50.0130.04711.13
5.2.40.0030.06011.03
5.2.30.0030.03710.94
5.2.20.0070.06310.86
5.2.10.0070.05010.94
5.2.00.0070.04710.73
5.1.60.0100.04710.04
5.1.50.0130.05010.00
5.1.40.0100.0479.96
5.1.30.0070.04710.34
5.1.20.0100.03710.57
5.1.10.0030.03710.15
5.1.00.0030.03010.08
5.0.50.0070.0178.61
5.0.40.0000.0208.41
5.0.30.0030.0308.38
5.0.20.0070.0178.38
5.0.10.0000.0208.38
5.0.00.0000.0308.40
4.4.90.0030.0378.38
4.4.80.0030.0378.38
4.4.70.0000.0378.38
4.4.60.0000.0378.38
4.4.50.0030.0338.38
4.4.40.0030.0578.38
4.4.30.0030.0338.38
4.4.20.0000.0378.38
4.4.10.0030.0138.38
4.4.00.0030.0238.38
4.3.110.0030.0138.38
4.3.100.0100.0078.38
4.3.90.0000.0178.38
4.3.80.0000.0238.38
4.3.70.0000.0138.38
4.3.60.0000.0138.38
4.3.50.0000.0238.38
4.3.40.0000.0238.38
4.3.30.0000.0138.38
4.3.20.0000.0138.38
4.3.10.0000.0138.38
4.3.00.0000.0138.38

preferences:
51.49 ms | 401 KiB | 5 Q