3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ToStringTest { function toString() { echo 'toString'; throw new Exception('error'); } function __toString() { try { $this->toString(); } catch { echo 'hey, this is not cool'; } } } $test = new ToStringTest; $test = (string) $test;

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)
5.6.120.0070.08320.96
5.6.110.0100.07320.89
5.6.100.0070.03720.99
5.6.90.0000.05021.04
5.6.80.0070.07720.41
5.5.280.0100.05320.80
5.5.270.0030.09320.95
5.5.260.0130.05320.84
5.5.250.0170.07320.71
5.5.240.0000.07320.19
5.4.440.0670.05719.54
5.4.430.0370.06019.18
5.4.420.0470.06019.45
5.4.410.0470.06019.44
5.4.400.0670.05019.13
5.4.390.0270.06319.21
5.4.380.0670.06019.09
5.4.370.0370.05319.21
5.4.360.0630.06019.32
5.4.350.0830.04319.02
5.4.340.0630.06318.84
5.4.320.0500.06319.13
5.4.310.0430.06018.85
5.4.300.0630.05719.22
5.4.290.0430.06719.11
5.4.280.0630.05319.12
5.4.270.0670.06319.21
5.4.260.0430.06719.24
5.4.250.0470.05719.08
5.4.240.0600.04718.98
5.4.230.0430.07319.01
5.4.220.0630.05718.83
5.4.210.0630.05319.00
5.4.200.0470.06016.71
5.4.190.0500.06718.99
5.4.180.0470.06319.04
5.4.170.0600.06019.02
5.4.160.0530.06019.07
5.4.150.0670.05319.14
5.4.140.0500.06016.31
5.4.130.0600.06316.44
5.4.120.0430.05716.35
5.4.110.0430.04316.43
5.4.100.0670.05716.34
5.4.90.0670.04716.55
5.4.80.0800.04016.55
5.4.70.0430.06716.32
5.4.60.0470.04716.52
5.4.50.0500.06716.29
5.4.40.0430.07016.37
5.4.30.0530.06016.68
5.4.20.0570.03716.29
5.4.10.0600.05716.47
5.4.00.0600.05715.84
5.3.290.0570.05314.68
5.3.280.0570.05014.50
5.3.270.0630.07714.63
5.3.260.0700.05714.63
5.3.250.0600.06714.61
5.3.240.0570.05314.58
5.3.230.0530.06314.75
5.3.220.0570.04714.79
5.3.210.0530.07014.59
5.3.200.0670.04714.48
5.3.190.0530.07314.57
5.3.180.0530.06314.48
5.3.170.1000.05014.67
5.3.160.0530.06314.62
5.3.150.0500.06714.57
5.3.140.0570.04314.79
5.3.130.0700.05714.46
5.3.120.0400.06714.41
5.3.110.0670.05014.55
5.3.100.0600.06314.09
5.3.90.0700.05314.04
5.3.80.0870.04014.07
5.3.70.0470.07014.03
5.3.60.0570.06014.06
5.3.50.0570.05714.17
5.3.40.0800.05713.96
5.3.30.0500.06013.93
5.3.20.0570.05713.57
5.3.10.0530.04713.57
5.3.00.0470.05313.54
5.2.170.0430.04311.16
5.2.160.0470.04311.06
5.2.150.0470.05711.05
5.2.140.0600.05311.10
5.2.130.0400.05011.04
5.2.120.0500.03711.16
5.2.110.0430.04711.00
5.2.100.0700.04311.19
5.2.90.0470.04711.06
5.2.80.0530.05011.13
5.2.70.0530.03311.11
5.2.60.0430.05311.13
5.2.50.0500.04711.09
5.2.40.0330.04310.91
5.2.30.0470.03010.90
5.2.20.0400.05011.11
5.2.10.0330.04710.76
5.2.00.0230.04310.67
5.1.60.0400.0339.88
5.1.50.0530.0309.93
5.1.40.0430.03010.00
5.1.30.0330.03310.36
5.1.20.0330.04310.41
5.1.10.0370.03310.00
5.1.00.0330.03310.15
5.0.50.0330.0209.65
5.0.40.0270.0239.65
5.0.30.0270.0479.65
5.0.20.0170.0379.65
5.0.10.0230.0279.65
5.0.00.0270.0539.65
4.4.90.0200.0339.65
4.4.80.0070.0309.65
4.4.70.0170.0309.65
4.4.60.0170.0239.65
4.4.50.0200.0279.65
4.4.40.0130.0409.65
4.4.30.0130.0309.65
4.4.20.0200.0239.65
4.4.10.0170.0239.65
4.4.00.0200.0339.65
4.3.110.0230.0239.65
4.3.100.0300.0179.65
4.3.90.0200.0209.65
4.3.80.0170.0379.65
4.3.70.0200.0209.65
4.3.60.0030.0279.65
4.3.50.0100.0339.65
4.3.40.0230.0309.65
4.3.30.0100.0279.65
4.3.20.0100.0239.65
4.3.10.0130.0179.65
4.3.00.0130.0207.08

preferences:
143.88 ms | 1394 KiB | 7 Q