3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var1 = 123; $var2 = '456A'; $var3 = 789; echo to_number($var1) . "\n"; echo to_number($var2) . "\n"; echo to_number($var3) . "\n"; echo $var2 + 0, "\n"; # convert var to number function to_number($var) { return 0 + $var; }
based on oEKPD

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.0rc40.0160.00598.97
7.3.0rc30.0180.00716.46
7.3.0beta10.0070.00712.74
7.3.0alpha10.0060.00312.77
7.2.60.0070.01016.69
7.2.00.0000.01319.44
7.1.200.0090.00315.71
7.1.100.0000.01018.02
7.1.70.0090.00616.79
7.1.60.0100.01319.46
7.1.50.0070.01416.96
7.1.00.0070.07322.31
7.0.200.0030.00316.86
7.0.140.0070.07022.19
7.0.60.0070.03720.02
7.0.50.0030.03717.84
7.0.40.0200.07320.10
7.0.30.0300.08320.08
7.0.20.0170.04020.27
7.0.10.0070.08720.06
7.0.00.0070.04720.20
5.6.280.0070.07020.85
5.6.210.0130.07320.63
5.6.200.0030.08318.18
5.6.190.0000.09020.39
5.6.180.4230.04720.52
5.6.170.0270.07320.43
5.6.160.0170.07320.39
5.6.150.0070.08018.27
5.6.140.0070.04018.29
5.6.130.0000.07018.18
5.6.120.0030.05320.93
5.6.110.0100.03720.98
5.6.100.0130.07720.98
5.6.90.0030.07020.96
5.6.80.0100.08320.54
5.5.350.0330.07020.33
5.5.340.0070.05017.94
5.5.330.0070.08020.57
5.5.320.0270.05320.38
5.5.310.0030.05020.34
5.5.300.0070.04017.94
5.5.290.0070.08017.96
5.5.280.0000.04320.80
5.5.270.0100.08320.61
5.5.260.0130.08020.79
5.5.250.0030.04020.46
5.5.240.0270.07020.19
5.4.450.0670.03719.57
5.4.440.0170.03719.29
5.4.430.0330.04319.48
5.4.420.0300.03719.30
5.4.410.0130.05319.44
5.4.400.0470.03018.95
5.4.390.0300.04318.95
5.4.380.0170.07018.56
5.4.370.0430.04018.61
5.4.360.0430.04718.65
5.4.350.0230.05718.71
5.4.340.0300.06018.80
5.4.320.0060.03912.50
5.4.310.0060.03812.50
5.4.300.0040.03712.50
5.4.290.0070.04912.50
5.4.280.0050.04212.40
5.4.270.0090.03712.40
5.4.260.0060.03712.40
5.4.250.0080.03912.40
5.4.240.0030.04412.39
5.4.230.0060.03712.39
5.4.220.0080.03912.39
5.4.210.0070.03412.39
5.4.200.0070.03512.39
5.4.190.0020.04612.38
5.4.180.0070.04012.39
5.4.170.0090.03312.39
5.4.160.0070.03512.39
5.4.150.0030.03912.39
5.4.140.0050.03912.07
5.4.130.0070.03812.06
5.4.120.0030.04012.02
5.4.110.0060.03812.01
5.4.100.0080.03512.02
5.4.90.0090.03512.02
5.4.80.0090.03712.01
5.4.70.0090.03612.01
5.4.60.0050.03612.01
5.4.50.0060.03712.01
5.4.40.0050.04511.99
5.4.30.0020.04411.99
5.4.20.0060.03512.00
5.4.10.0030.03912.00
5.4.00.0040.03811.48
5.3.290.0060.03912.80
5.3.280.0050.03912.71
5.3.270.0070.04312.72
5.3.260.0080.03812.72
5.3.250.0060.03612.72
5.3.240.0050.03712.72
5.3.230.0060.03712.71
5.3.220.0030.04012.68
5.3.210.0090.03512.68
5.3.200.0080.03512.68
5.3.190.0100.03812.68
5.3.180.0080.03612.68
5.3.170.0070.03512.66
5.3.160.0040.03812.68
5.3.150.0060.03712.67
5.3.140.0040.03912.66
5.3.130.0060.03912.66
5.3.120.0080.03612.66
5.3.110.0080.03712.66
5.3.100.0070.03612.12
5.3.90.0090.03512.10
5.3.80.0020.04212.09
5.3.70.0100.03612.09
5.3.60.0060.04212.07
5.3.50.0060.03512.02
5.3.40.0080.03712.02
5.3.30.0090.03711.98
5.3.20.0050.03811.76
5.3.10.0090.03311.72
5.3.00.0030.04811.71
5.2.170.0040.0329.21
5.2.160.0060.0309.22
5.2.150.0030.0319.22
5.2.140.0040.0349.21
5.2.130.0030.0339.18
5.2.120.0050.0279.17
5.2.110.0050.0349.18
5.2.100.0100.0249.17
5.2.90.0080.0349.17
5.2.80.0030.0349.17
5.2.70.0040.0309.16
5.2.60.0090.0369.13
5.2.50.0050.0299.10
5.2.40.0040.0299.07
5.2.30.0070.0309.05
5.2.20.0050.0359.03
5.2.10.0060.0298.95
5.2.00.0060.0278.80
5.1.60.0050.0258.09
5.1.50.0020.0308.09
5.1.40.0030.0308.06
5.1.30.0070.0278.41
5.1.20.0070.0268.43
5.1.10.0040.0288.16
5.1.00.0050.0268.16
5.0.50.0060.0286.63
5.0.40.0080.0176.50
5.0.30.0030.0396.31
5.0.20.0070.0296.30
5.0.10.0030.0206.28
5.0.00.0040.0356.27
4.4.90.0040.0174.78
4.4.80.0050.0134.75
4.4.70.0020.0174.75
4.4.60.0040.0144.75
4.4.50.0020.0174.77
4.4.40.0040.0274.71
4.4.30.0050.0184.76
4.4.20.0040.0144.84
4.4.10.0010.0174.84
4.4.00.0040.0254.75
4.3.110.0070.0154.67
4.3.100.0010.0184.66
4.3.90.0050.0214.63
4.3.80.0010.0264.58
4.3.70.0030.0214.63
4.3.60.0020.0154.63
4.3.50.0030.0174.63
4.3.40.0030.0264.54
4.3.30.0030.0203.32
4.3.20.0030.0183.30
4.3.10.0020.0153.26
4.3.00.0030.02015.68