3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Entity { #[ORM\Column(type: 'decimal', precision: 10, scale: 4)] private Decimal $subtotal; public function getSubtotal() { return $this->subtotal; } public function setSubtotal(Decimal $value) { $this->subtotal = $value->toFixed(4); return $this; } } class Decimal { private string $value = '0.0'; public function __construct(string $value) { $this->value = $value; } public function getValue(): string { return $this->value; } public function toFixed(int $scale): Decimal { // rough example for adjusting precision - do not use return new self(bcadd($this->value, '0', $scale)); } } //////////////// $entity = new Entity(); $entity->setSubtotal(new Decimal('1337.987654321')); echo $entity->getSubtotal()->getValue();

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.5.60.0130.00518.62
8.5.50.0080.00916.84
8.5.30.0130.00519.99
8.5.20.0120.00520.29
8.5.10.0090.01118.67
8.5.00.0090.01220.00
8.4.210.0120.00921.41
8.4.180.0110.01120.66
8.4.170.0150.00724.08
8.4.160.0120.01023.94
8.4.150.0080.00516.95
8.4.140.0140.00617.66
8.4.130.0130.00717.72
8.4.120.0140.00622.42
8.4.110.0080.01118.76
8.4.100.0070.00417.83
8.4.90.0100.00518.61
8.4.80.0110.01017.83
8.4.70.0020.00617.85
8.4.60.0120.00718.73
8.4.50.0160.00519.53
8.4.40.0130.00719.55
8.4.30.0060.00320.46
8.4.20.0100.01017.95
8.4.10.0000.00920.35
8.3.300.0100.01020.95
8.3.290.0110.01020.83
8.3.280.0090.01118.26
8.3.270.0100.01016.39
8.3.260.0110.00816.47
8.3.250.0080.01018.71
8.3.240.0090.00917.23
8.3.230.0040.00516.57
8.3.220.0070.00817.41
8.3.210.0030.00516.43
8.3.200.0060.00316.73
8.3.190.0140.00417.26
8.3.180.0140.00516.63
8.3.170.0180.00018.80
8.3.160.0150.00320.73
8.3.150.0130.00620.79
8.3.140.0080.00018.38
8.3.130.0120.00316.70
8.3.120.0030.01219.14
8.3.110.0040.00420.94
8.3.100.0030.01424.06
8.3.90.0050.00326.77
8.3.80.0060.00318.31
8.3.70.0100.00716.58
8.3.60.0150.00016.63
8.3.50.0090.00618.22
8.3.40.0100.01019.39
8.3.30.0070.00718.89
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0050.00226.16
8.2.300.0140.00617.97
8.2.290.0100.00920.25
8.2.280.0100.00518.49
8.2.270.0120.00417.46
8.2.260.0070.01020.71
8.2.250.0080.00016.53
8.2.240.0000.01518.99
8.2.230.0080.00022.58
8.2.220.0040.00437.54
8.2.210.0000.00826.77
8.2.200.0040.00716.63
8.2.190.0190.00316.58
8.2.180.0110.00425.92
8.2.170.0110.01118.91
8.2.160.0030.01022.96
8.2.150.0070.00025.66
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00019.66
8.2.110.0090.00019.33
8.2.100.0090.00317.91
8.2.90.0070.00321.15
8.2.80.0040.00418.02
8.2.70.0060.00317.75
8.2.60.0040.00417.63
8.2.50.0060.00317.98
8.2.40.0080.00019.89
8.2.30.0040.00418.01
8.2.20.0040.00420.44
8.2.10.0040.00417.94
8.2.00.0000.00719.14
8.1.340.0110.01021.69
8.1.330.0090.01022.01
8.1.320.0080.01116.26
8.1.310.0070.00316.86
8.1.300.0090.00618.68
8.1.290.0060.00318.88
8.1.280.0000.01425.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0030.00620.64
8.1.230.0040.00720.94
8.1.220.0030.00517.79
8.1.210.0000.00819.10
8.1.200.0070.00317.35
8.1.190.0080.00017.23
8.1.180.0050.00318.10
8.1.170.0040.00417.62
8.1.160.0000.00818.89
8.1.150.0050.00518.61
8.1.140.0000.00717.35
8.1.130.0000.00718.86
8.1.120.0080.00017.31
8.1.110.0000.00717.41
8.1.100.0040.00417.48
8.1.90.0040.00417.32
8.1.80.0060.00417.45
8.1.70.0070.00017.38
8.1.60.0030.00517.52
8.1.50.0030.00517.54
8.1.40.0030.00617.53
8.1.30.0100.00517.66
8.1.20.0090.00917.56
8.1.10.0180.00017.54
8.1.00.0150.00417.46
8.0.300.0040.00421.63
8.0.290.0060.00316.63
8.0.280.0070.00018.47
8.0.270.0000.00916.84
8.0.260.0000.00618.38
8.0.250.0070.00016.91
8.0.240.0030.00316.94
8.0.230.0060.00316.86
8.0.220.0040.00416.95
8.0.210.0000.00716.89
8.0.200.0000.00616.88
8.0.190.0080.00016.91
8.0.180.0000.00816.84
8.0.170.0080.01116.87
8.0.160.0120.00816.75
8.0.150.0110.00816.77
8.0.140.0100.01016.70
8.0.130.0160.00316.82
8.0.120.0190.00316.85
8.0.110.0150.00416.70
8.0.100.0120.00816.83
8.0.90.0130.00516.79
8.0.80.0110.00716.80
8.0.70.0210.00316.88
8.0.60.0200.00716.79
8.0.50.0210.00316.91
8.0.30.0170.00616.76
8.0.20.0240.00316.84
8.0.10.0200.00017.09
7.4.330.0050.00015.55
7.4.320.0040.00416.51
7.4.300.0000.00716.42
7.4.290.0040.00416.44
7.4.280.0210.00316.64
7.4.270.0150.00816.59
7.4.260.0170.00616.57
7.4.250.0110.01116.54
7.4.240.0140.00316.58
7.4.230.0100.01016.50
7.4.220.0130.00616.49
7.4.210.0140.00516.53
7.4.200.0120.00816.57
7.4.190.0160.00316.62
7.4.180.0130.00716.61
7.4.160.0190.00016.60
7.4.150.0140.00416.57
7.4.140.0200.00016.41
7.4.130.0140.00716.54
7.4.120.0150.00416.47
7.4.110.0110.00816.56
7.4.100.0160.00316.38
7.4.90.0150.00616.45
7.4.80.0140.00516.50
7.4.70.0210.00016.43
7.4.60.0110.00416.54
7.4.50.0070.01116.27
7.4.40.0120.00316.40
7.4.30.0040.00816.54
7.4.20.0090.00916.49
7.4.10.0000.01416.41
7.4.00.0050.01016.36

preferences:
68.25 ms | 1246 KiB | 5 Q