3v4l.org

run code in 300+ PHP versions simultaneously
<?php class one { private $var; public function __construct() { $this->var = array(); } public function saveIteration($a) { $this->var[] = $a; return $this->var; } public function getVar() { return $this->var; } } $one = new one(); $time_start = microtime(true); for ($i = 0; $i < 10000; $i++) { $res = $one->saveIteration($i); } echo "First took " . number_format(microtime(true) - $time_start, 3) . " sec.\n"; //reset unset($one);$one = new one(); $time_start = microtime(true); for ($i = 0; $i < 10000; $i++) { $one->saveIteration($i); } $res = $one->getVar(); echo "Second took " . number_format(microtime(true) - $time_start, 3) . " sec.";

Abusive script

This script was stopped while abusing our resources

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)
7.4.50.0100.39217.51
7.4.40.0070.36817.47
7.4.30.0160.44117.46
7.4.20.0160.38017.55
7.4.10.0130.36217.32
7.4.00.0130.37417.71
7.3.170.0100.36217.50
7.3.160.0100.37317.55
7.3.150.0130.38917.56
7.3.140.0060.42917.86
7.3.130.0160.36317.57
7.3.120.0060.41617.57
7.3.110.0100.36917.58
7.3.100.0130.36617.77
7.3.90.0190.35617.51
7.3.80.0030.37917.61
7.3.70.0100.36217.54
7.3.60.0130.36217.63
7.3.50.0100.35717.57
7.3.40.0160.35717.74
7.3.30.0130.37517.66
7.3.20.0130.37617.76
7.3.10.0530.26917.00
7.3.00.0440.27616.97
7.2.290.0200.36517.75
7.2.280.0070.42017.80
7.2.270.0100.37017.89
7.2.260.0130.37117.82
7.2.250.0130.37718.01
7.2.240.0060.38918.04
7.2.230.0130.38217.85
7.2.220.0130.36817.69
7.2.210.0160.35917.91
7.2.200.0130.36217.78
7.2.190.0100.36417.68
7.2.180.0070.36417.91
7.2.170.0130.36117.77
7.2.160.0190.39017.75
7.2.150.0070.37518.10
7.2.140.0070.37817.89
7.2.130.0890.26617.21
7.2.120.0480.26917.12
7.2.110.0430.29117.07
7.2.100.0320.27917.22
7.2.90.0410.27217.02
7.2.80.0370.27817.09
7.2.70.0280.26917.16
7.2.60.0420.26317.14
7.2.50.0330.31617.13
7.2.40.0330.29917.20
7.2.30.0500.28017.10
7.2.20.0480.29617.15
7.2.10.0270.29916.91
7.2.00.0690.17816.54
7.1.330.0250.36016.50
7.1.320.0030.37816.95
7.1.310.0100.36816.61
7.1.300.0160.35716.76
7.1.290.0230.36416.91
7.1.280.0160.37716.63
7.1.270.0100.37516.74
7.1.260.0030.36916.67
7.1.250.0470.27316.05
7.1.240.0560.27316.08
7.1.230.0370.28215.97
7.1.220.0430.29215.95
7.1.210.0500.27315.96
7.1.200.0470.27516.05
7.1.190.0410.26116.04
7.1.180.0490.28016.03
7.1.170.0630.27615.97
7.1.160.0570.29616.08
7.1.150.0480.29416.10
7.1.140.0400.28216.00
7.1.130.0800.27916.04
7.1.120.0810.18515.29
7.1.110.0860.18615.33
7.1.100.0730.16215.37
7.1.90.0820.18915.23
7.1.80.0970.22315.32
7.1.70.0870.17515.20
7.1.60.0700.19015.32
7.1.50.0510.17315.19
7.1.40.0620.17915.06
7.1.30.0700.15415.10
7.1.20.0730.19915.07
7.1.10.0540.15815.07
7.1.00.0490.17915.16
7.0.330.0420.28115.80
7.0.320.0560.27715.78
7.0.310.0380.27215.74
7.0.300.0360.29515.57
7.0.290.0550.30215.66
7.0.280.0500.28315.81
7.0.270.0480.30615.71
7.0.260.0680.18614.59
7.0.250.0950.18315.03
7.0.240.0550.17715.13
7.0.230.0870.15815.04
7.0.220.0620.17614.86
7.0.210.0920.18014.79
7.0.200.0550.21214.70
7.0.190.0520.18214.82
7.0.180.0530.17514.84
7.0.170.0750.20314.91
7.0.160.0740.16815.05
7.0.150.0470.15714.72
7.0.140.0620.16514.84
7.0.130.0610.17914.72
7.0.120.0640.20315.02
7.0.110.0570.18214.80
7.0.100.0530.16714.71
7.0.90.0790.34118.04
7.0.80.0860.35018.04
7.0.70.0430.33717.90
7.0.60.0580.33918.02
7.0.50.0360.33318.57
7.0.40.0510.34218.57
7.0.30.0450.30818.59
7.0.20.0560.35218.55
7.0.10.0330.31818.51
7.0.00.0220.29918.41
5.6.400.0222.43518.23
5.6.390.0292.42418.61
5.6.380.0352.29917.88
5.6.370.0362.17318.00
5.6.360.0312.23917.82
5.6.350.0342.18017.88
5.6.340.0172.19117.97
5.6.330.0262.20617.77
5.6.320.0261.93516.90
5.6.310.0322.10217.15
5.6.300.0272.04517.37
5.6.290.0202.14717.39
5.6.280.0171.99017.31
5.6.270.0231.99717.14
5.6.260.0131.98117.51
5.6.250.0131.92716.86
5.6.240.0202.11620.01
5.6.230.0321.79919.74
5.6.220.0381.97719.74
5.6.210.0401.83819.82
5.6.200.0312.16920.27
5.6.190.0232.24420.53
5.6.180.0382.10420.16
5.6.170.0452.28820.04
5.6.160.0252.29320.18
5.6.150.0202.24520.31
5.6.140.0222.18520.27
5.6.130.0352.26620.34
5.6.120.0302.10820.12
5.6.110.0322.26520.00
5.6.100.0252.17419.95
5.6.90.0312.10920.08
5.6.80.0252.21319.71
5.6.70.0362.24819.61
5.6.60.0282.18919.89
5.6.50.0222.20119.85
5.6.40.0302.27919.89
5.6.30.0252.18919.77
5.6.20.0202.12819.80
5.6.10.0182.22619.79
5.6.00.0222.21819.70

preferences:
41.03 ms | 403 KiB | 5 Q