3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createStartString(rating) { $message = "wrong answer"; echo "<script type='text/javascript'>alert('$message');</script>"; $globalCounter = 0; $starRating= ""; $tempRating=$rating; $splitedStr = tempRating.toString().split("."); $firstNumber = parseInt(splitedStr[0]); $secondNumber = parseInt(splitedStr[1]); for($counter = 0; $counter < 5; $counter++) { if($counter < $firstNumber ) { $starRating = $starRating + "<img src='/images/fullstar.png' height='20' width='20' />"; $globalCounter ++; } } if($secondNumber > 0) { $starRating = $starRating + "<img src='/images/halfstar.png' height='20' width='20' />"; $globalCounter ++; } for ($i =0 ;$i< 5 - $globalCounter ; i++ ) { $starRating = $starRating + "<img src='/images/blankstar.png' height='20' width='20' />"; } return '1'; } ?>

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.4.280.0060.04012.40
5.4.270.0090.04112.40
5.4.260.0070.03812.40
5.4.250.0090.04012.41
5.4.240.0070.03412.40
5.4.230.0080.03912.39
5.4.220.0080.03512.39
5.4.210.0090.03812.39
5.4.200.0080.04412.39
5.4.190.0060.03512.39
5.4.180.0080.03812.39
5.4.170.0100.03112.40
5.4.160.0070.03712.40
5.4.150.0080.04112.39
5.4.140.0070.03512.08
5.4.130.0090.03812.07
5.4.120.0080.03912.03
5.4.110.0040.03612.02
5.4.100.0040.03712.03
5.4.90.0060.03612.03
5.4.80.0060.03812.03
5.4.70.0060.04012.02
5.4.60.0040.03912.02
5.4.50.0070.04212.03
5.4.40.0090.03712.02
5.4.30.0080.04312.01
5.4.20.0080.03312.00
5.4.10.0060.04012.00
5.4.00.0060.03711.50
5.3.280.0080.04112.71
5.3.270.0120.05012.72
5.3.260.0130.03712.72
5.3.250.0050.03812.72
5.3.240.0060.04012.72
5.3.230.0110.03512.71
5.3.220.0100.03712.68
5.3.210.0040.04112.68
5.3.200.0050.03712.68
5.3.190.0040.04512.68
5.3.180.0070.03812.67
5.3.170.0040.04112.67
5.3.160.0100.03812.68
5.3.150.0040.03812.68
5.3.140.0070.04012.66
5.3.130.0060.04712.66
5.3.120.0090.05212.66
5.3.110.0080.05312.66
5.3.100.0050.04612.13
5.3.90.0030.05612.11
5.3.80.0090.04612.09
5.3.70.0050.03712.09
5.3.60.0060.04712.08
5.3.50.0050.04012.02
5.3.40.0070.04112.02
5.3.30.0120.06011.98
5.3.20.0070.04111.76
5.3.10.0060.04111.73
5.3.00.0100.03311.71
5.2.170.0070.0399.21
5.2.160.0030.0309.21
5.2.150.0050.0379.22
5.2.140.0050.0409.21
5.2.130.0060.0369.17
5.2.120.0030.0319.18
5.2.110.0040.0299.18
5.2.100.0040.0319.18
5.2.90.0060.0349.17
5.2.80.0060.0329.18
5.2.70.0050.0329.18
5.2.60.0060.0339.12
5.2.50.0030.0369.09
5.2.40.0080.0329.06
5.2.30.0070.0389.05
5.2.20.0090.0349.04
5.2.10.0050.0328.95
5.2.00.0080.0378.80
5.1.60.0030.0278.09
5.1.50.0060.0288.08
5.1.40.0060.0328.07
5.1.30.0050.0308.42
5.1.20.0050.0268.44
5.1.10.0050.0328.16
5.1.00.0070.0278.16
5.0.50.0040.0256.64
5.0.40.0040.0326.50
5.0.30.0040.0356.31
5.0.20.0050.0266.29
5.0.10.0070.0216.26
5.0.00.0050.0386.25
4.4.90.0030.0204.78
4.4.80.0020.0194.75
4.4.70.0050.0214.75
4.4.60.0030.0214.75
4.4.50.0050.0194.77
4.4.40.0010.0334.71
4.4.30.0030.0244.76
4.4.20.0020.0194.84
4.4.10.0050.0234.85
4.4.00.0020.0304.76
4.3.110.0020.0204.66
4.3.100.0040.0224.66
4.3.90.0030.0194.63
4.3.80.0070.0264.58
4.3.70.0040.0164.63
4.3.60.0070.0134.63
4.3.50.0070.0234.63
4.3.40.0040.0284.54
4.3.30.0040.0223.30
4.3.20.0040.0233.29
4.3.10.0020.0213.23
4.3.00.0100.02010.37

preferences:
141.84 ms | 1394 KiB | 7 Q