3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attempts = 100000; $test = 1; if ($test == 1) { $start = microtime(true); for ($i = 0; $i < $attempts; $i++) { $user = array( 'id' => 27, 'name' => 'Pepe' ); } $end = microtime(true); echo 'Array: ' . ($end - $start) . " <br />\n"; } if ($test == 2) { $start = microtime(true); for ($i = 0; $i < $attempts; $i++) { $user = new stdClass(); $user->id = 27; $user->name = 'Pepe'; } $end = microtime(true); echo 'Object: ' . ($end - $start) . " <br />\n"; } if ($test == 3) { $start = microtime(true); for ($i = 0; $i < $attempts; $i++) { $user = (object) array( 'id' => 27, 'name' => 'Pepe' ); } $end = microtime(true); echo 'Cast: ' . ($end - $start) . " <br />\n"; }

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.00.0070.01114.71
7.3.120.0070.01414.80
7.3.110.0110.00714.73
7.3.100.0060.00914.65
7.3.90.0100.00714.67
7.3.80.0040.01414.59
7.3.70.0030.01614.94
7.3.60.0090.00314.70
7.3.50.0090.00614.74
7.3.40.0070.00714.73
7.3.30.0090.00914.96
7.3.20.0040.01416.56
7.3.10.0000.01016.67
7.3.00.0030.01016.46
7.2.250.0030.01415.20
7.2.240.0040.01414.91
7.2.230.0100.01014.98
7.2.220.0130.00615.11
7.2.210.0100.00614.82
7.2.200.0100.00615.14
7.2.190.0060.01014.97
7.2.180.0000.01714.71
7.2.170.0070.01015.13
7.2.00.0030.01319.51
7.1.330.0040.01816.00
7.1.320.0030.01615.95
7.1.310.0030.01615.95
7.1.300.0040.01215.86
7.1.290.0090.00915.77
7.1.280.0040.01815.86
7.1.270.0060.00915.82
7.1.260.0030.01315.63
7.1.70.0030.00517.25
7.1.60.0120.01619.46
7.1.50.0090.01616.84
7.1.00.0030.07722.53
7.0.200.0060.01216.70
7.0.140.0070.08021.99
7.0.60.0100.08319.93
7.0.50.0070.07017.83
7.0.40.0100.09020.05
7.0.30.0370.07720.16
7.0.20.0230.04720.00
7.0.10.0230.05020.13
7.0.00.0070.09020.11
5.6.280.0130.09320.87
5.6.210.0100.09720.57
5.6.200.0170.04318.19
5.6.190.0100.10020.45
5.6.180.4130.05020.35
5.6.170.0270.09020.48
5.6.160.0070.06020.49
5.6.150.0100.08018.09
5.6.140.0030.10718.11
5.6.130.0100.06318.07
5.6.120.0170.09321.04
5.6.110.0000.07320.98
5.6.100.0070.10321.02
5.6.90.0030.09021.10
5.6.80.0100.09720.43
5.6.70.0370.08320.48
5.5.350.0200.10020.45
5.5.340.0030.06318.00
5.5.330.0100.10320.29
5.5.320.0230.06720.29
5.5.310.0270.05320.50
5.5.300.0070.06717.90
5.5.290.0100.06717.91
5.5.280.0100.09720.66
5.5.270.0100.09020.88
5.5.260.0130.09720.86
5.5.250.0170.08720.62
5.5.240.0100.08720.13
5.4.450.0430.06319.48
5.4.440.0670.08019.51
5.4.430.1000.09319.44
5.4.420.0870.00019.35
5.4.410.0130.07718.70
5.4.400.0330.06318.81
5.4.390.0170.07718.58
5.4.380.0330.06718.70
5.4.370.0130.07718.67
5.4.360.0130.07718.68
5.4.350.0060.05211.98
5.4.340.0080.06411.98
5.4.320.0090.05212.46
5.4.310.0090.06712.46
5.4.300.0030.08812.46
5.4.290.0140.07912.46
5.4.280.0130.07412.36
5.4.270.0120.07512.36
5.4.260.0140.07512.36
5.4.250.0060.07812.36
5.4.240.0110.07912.36
5.4.230.0090.07912.35
5.4.220.0090.07612.35
5.4.210.0030.05912.35
5.4.200.0090.05412.35
5.4.190.0040.05712.34
5.4.180.0060.05912.34
5.4.170.0060.05612.36
5.4.160.0100.04912.35
5.4.150.0040.06012.35
5.4.140.0070.05312.03
5.4.130.0110.04812.02
5.4.120.0040.05711.98
5.4.110.0060.05311.98
5.4.100.0100.04711.97
5.4.90.0040.05611.98
5.4.80.0100.05211.98
5.4.70.0050.05211.97
5.4.60.0080.06211.97
5.4.50.0060.05111.97
5.4.40.0110.04811.96
5.4.30.0090.04711.96
5.4.20.0060.05711.95
5.4.10.0050.06811.96
5.4.00.0120.07511.45
5.3.290.0050.06912.80
5.3.280.0100.09412.71
5.3.270.0080.08612.73
5.3.260.0060.06212.72
5.3.250.0080.05512.71
5.3.240.0070.05712.72
5.3.230.0080.05612.70
5.3.220.0070.07312.68
5.3.210.0090.06812.68
5.3.200.0100.06812.68
5.3.190.0060.06112.67
5.3.180.0060.05712.68
5.3.170.0070.05812.67
5.3.160.0060.05912.67
5.3.150.0050.05712.67
5.3.140.0050.06912.66
5.3.130.0080.06412.66
5.3.120.0080.06112.66
5.3.110.0100.05812.65
5.3.100.0100.06912.12
5.3.90.0080.05712.09
5.3.80.0060.07512.07
5.3.70.0050.05712.08
5.3.60.0030.05912.06
5.3.50.0080.06312.00
5.3.40.0080.05712.00
5.3.30.0080.05511.96
5.3.20.0060.06511.74
5.3.10.0060.05911.71
5.3.00.0040.05611.70
5.2.170.0060.0589.20
5.2.160.0070.0539.20
5.2.150.0060.0569.20
5.2.140.0070.0599.20
5.2.130.0070.0809.15
5.2.120.0080.0659.16
5.2.110.0050.0549.16
5.2.100.0080.0569.16
5.2.90.0020.0599.16
5.2.80.0060.0529.16
5.2.70.0090.0549.15
5.2.60.0050.0549.11
5.2.50.0020.0629.07
5.2.40.0070.0509.05
5.2.30.0050.0539.03
5.2.20.0050.0589.02
5.2.10.0070.0578.96
5.2.00.0060.0578.83
5.1.60.0060.0698.11
5.1.50.0100.0718.11
5.1.40.0070.0778.09
5.1.30.0060.0628.44
5.1.20.0070.0458.46
5.1.10.0040.0638.19
5.1.00.0050.0758.19
5.0.50.0070.0796.67
5.0.40.0050.0996.52
5.0.30.0090.0876.34
5.0.20.0040.0696.31
5.0.10.0050.0646.29
5.0.00.0060.0746.28
4.4.90.0030.0644.78
4.4.80.0030.0614.75
4.4.70.0020.0584.76
4.4.60.0020.0624.76
4.4.50.0050.0714.77
4.4.40.0040.0804.71
4.4.30.0050.0684.76
4.4.20.0040.0624.84
4.4.10.0050.0594.85
4.4.00.0010.0704.76
4.3.110.0060.0534.67
4.3.100.0020.0604.66
4.3.90.0020.0634.64
4.3.80.0030.0674.59
4.3.70.0030.0604.63
4.3.60.0040.0574.63
4.3.50.0030.0564.63
4.3.40.0040.0634.55
4.3.30.0040.0533.35
4.3.20.0020.0533.34
4.3.10.0020.0563.29
4.3.00.0000.05016.14

preferences:
32.35 ms | 401 KiB | 5 Q