3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $_field = "abcdefghijklmnopqrstuvwxyz"; public function __construct() {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new A(); $time_taken = microtime(true) - $start; echo 'With construct: ' . $time_taken . 's' . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new B(); $time_taken = microtime(true) - $start; echo 'Without construct: ' . $time_taken . 's' . PHP_EOL;

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.3.10.0070.02316.62
7.3.00.0070.02416.39
7.2.130.0030.02716.92
7.2.120.0070.02616.94
7.2.110.0030.02316.63
7.2.100.0030.02616.78
7.2.90.0030.03017.01
7.2.80.0040.02816.86
7.2.70.0030.02616.99
7.2.60.0070.02716.79
7.2.50.0130.02316.96
7.2.40.0120.01917.03
7.2.30.0070.02416.96
7.2.20.0060.02216.89
7.2.10.0000.03017.01
7.2.00.0030.02618.12
7.1.250.0040.03915.51
7.1.70.0000.02617.20
7.1.60.0170.03719.82
7.1.50.0160.03617.04
7.1.00.0030.09722.54
7.0.200.0030.02616.73
7.0.140.0070.09322.11
7.0.110.0470.07020.01
7.0.100.0730.10320.13
7.0.90.0400.07719.93
7.0.80.0500.08019.94
7.0.70.0070.09720.07
7.0.60.0030.07320.05
7.0.50.0070.11319.82
7.0.40.0030.11319.86
7.0.30.0030.05319.71
7.0.20.0070.08319.80
7.0.10.0030.09719.68
7.0.00.0070.09319.74
5.6.280.0100.11321.08
5.6.260.0070.10020.89
5.6.250.0070.08020.62
5.6.240.0130.11320.70
5.6.230.0030.08020.62
5.6.220.0070.06720.65
5.6.210.0030.14320.68
5.6.200.0030.13320.60
5.6.190.0130.12020.59
5.6.180.0100.11020.47
5.6.170.0100.11320.58
5.6.160.0030.09020.71
5.6.150.0070.09720.64
5.6.140.0030.07320.56
5.6.130.0070.07020.60
5.6.120.0070.06320.64
5.6.110.0100.11320.64
5.6.100.0130.08720.67
5.6.90.0130.10320.57
5.6.80.0100.05019.97
5.6.70.0030.09319.98
5.6.60.0100.09019.96
5.6.50.0000.06720.09
5.6.40.0070.06320.00
5.6.30.0030.07719.83
5.6.20.0070.08020.00
5.6.10.0070.10020.02
5.6.00.0070.07019.98
5.5.380.0100.11717.62
5.5.370.0030.07717.51
5.5.360.0100.10717.68
5.5.350.0030.06717.75
5.5.340.0100.11718.09
5.5.330.0070.09018.10
5.5.320.0070.12017.96
5.5.310.0030.11717.91
5.5.300.0000.09318.22
5.5.290.0130.08317.91
5.5.280.0100.10717.93
5.5.270.0030.10018.12
5.5.260.0100.07318.13
5.5.250.0000.07018.03
5.5.240.0100.06017.31
5.5.230.0000.11317.44
5.5.220.0030.08717.30
5.5.210.0030.09317.51
5.5.200.0200.06017.58
5.5.190.0070.10717.26
5.5.180.0030.10317.27
5.5.160.0030.07017.18
5.5.150.0000.07017.30
5.5.140.0100.09717.43
5.5.130.0030.06717.39
5.5.120.0030.06717.45
5.5.110.0000.07317.39
5.5.100.0000.08717.32
5.5.90.0030.11717.47
5.5.80.0030.12017.37
5.5.70.0030.08317.20
5.5.60.0100.10717.38
5.5.50.0070.11317.20
5.5.40.0030.11317.50
5.5.30.0070.07017.15
5.5.20.0130.12717.33
5.5.10.0070.06317.19
5.5.00.0070.10317.13
5.4.450.0070.10719.55
5.4.440.0000.06319.49
5.4.430.0070.06319.65
5.4.420.0170.09319.30
5.4.410.0100.07019.20
5.4.400.0030.08019.01
5.4.390.0000.12019.20
5.4.380.0070.11318.96
5.4.370.0070.08319.02
5.4.360.0070.08019.01
5.4.350.0070.07719.18
5.4.340.0000.07019.01
5.4.320.0030.07019.18
5.4.310.0130.08719.03
5.4.300.0030.09719.09
5.4.290.0030.06719.16
5.4.280.0000.07019.33
5.4.270.0100.09319.00
5.4.260.0100.06019.18
5.4.250.0030.11719.23
5.4.240.0070.12319.18
5.4.230.0000.08019.17
5.4.220.0000.11319.16
5.4.210.0030.07319.00
5.4.200.0000.10018.95
5.4.190.0030.08019.21
5.4.180.0130.08019.23
5.4.170.0000.08319.04
5.4.160.0100.09718.98
5.4.150.0100.11019.07
5.4.140.0070.06716.41
5.4.130.0130.11716.55
5.4.120.0000.07716.40
5.4.110.0000.06716.56
5.4.100.0000.06716.52
5.4.90.0000.08016.46
5.4.80.0070.07716.59
5.4.70.0030.13716.63
5.4.60.0030.09016.23
5.4.50.0070.09016.33
5.4.40.0070.06316.46
5.4.30.0000.07716.54
5.4.20.0000.06316.44
5.4.10.0030.05716.52
5.4.00.0030.06315.84
5.3.290.0070.08714.66
5.3.280.0030.10014.62
5.3.270.0030.08314.62
5.3.260.0130.12014.74
5.3.250.0030.12714.64
5.3.240.0000.11014.61
5.3.230.0000.08714.61
5.3.220.0070.08314.43
5.3.210.0070.13314.43
5.3.200.0030.08314.58
5.3.190.0030.11314.59
5.3.180.0070.07714.69
5.3.170.0100.07314.58
5.3.160.0000.09714.71
5.3.150.0030.08314.79
5.3.140.0000.14014.66
5.3.130.0030.08314.55
5.3.120.0070.08014.68
5.3.110.0030.08314.41
5.3.100.0030.08714.01
5.3.90.0030.08014.02
5.3.80.0070.12014.16
5.3.70.0030.08314.03
5.3.60.0030.08314.07
5.3.50.0030.12713.96
5.3.40.0070.12313.96
5.3.30.0030.10713.92
5.3.20.0000.13713.70
5.3.10.0030.09013.64
5.3.00.0030.10313.61
5.2.170.0230.08012.08
5.2.160.0030.07712.08
5.2.150.0000.07712.08
5.2.140.0070.13312.08
5.2.130.0000.13012.08
5.2.120.0070.13712.08
5.2.110.0070.14012.08
5.2.100.0030.11312.08
5.2.90.0130.08012.08
5.2.80.0030.08312.08
5.2.70.0030.07012.08
5.2.60.0070.11312.08
5.2.50.0030.07712.08
5.2.40.0030.09012.08
5.2.30.0070.07312.08
5.2.20.0070.10312.08
5.2.10.0100.12012.08
5.2.00.0070.12712.08
5.1.60.0000.09012.08
5.1.50.0070.10012.08
5.1.40.0030.10012.08
5.1.30.0000.09312.08
5.1.20.0030.11012.08
5.1.10.0000.10312.08
5.1.00.0100.08312.08
5.0.50.0100.12712.08
5.0.40.0030.14312.08
5.0.30.0000.16712.08
5.0.20.0030.11312.08
5.0.10.0000.11012.08
5.0.00.0000.14312.08
4.4.90.0030.03012.08
4.4.80.0000.02012.08
4.4.70.0000.02712.08
4.4.60.0000.01712.08
4.4.50.0030.01312.08
4.4.40.0000.02312.08
4.4.30.0000.02012.08
4.4.20.0000.02012.08
4.4.10.0030.03312.08
4.4.00.0000.04012.08
4.3.110.0030.03312.08
4.3.100.0000.02312.08
4.3.90.0000.03312.08
4.3.80.0070.04712.08
4.3.70.0030.03012.08
4.3.60.0030.02012.08
4.3.50.0000.02012.08
4.3.40.0030.02712.08
4.3.30.0000.01312.08
4.3.20.0030.02312.08
4.3.10.0030.03012.08
4.3.00.0000.02312.08

preferences:
39.37 ms | 401 KiB | 5 Q