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.0030.03912.40
5.4.270.0100.03812.40
5.4.260.0100.03912.40
5.4.250.0060.04412.41
5.4.240.0090.04812.41
5.4.230.0050.03812.40
5.4.220.0070.03812.39
5.4.210.0100.04912.40
5.4.200.0060.03612.40
5.4.190.0060.03712.39
5.4.180.0070.04312.39
5.4.170.0060.03712.40
5.4.160.0080.03712.39
5.4.150.0010.04012.39
5.4.140.0100.03212.09
5.4.130.0120.02812.07
5.4.120.0080.04112.03
5.4.110.0070.03512.03
5.4.100.0070.03512.03
5.4.90.0070.05612.02
5.4.80.0090.04212.03
5.4.70.0070.03412.02
5.4.60.0070.03612.02
5.4.50.0070.03512.02
5.4.40.0040.04212.01
5.4.30.0080.03412.01
5.4.20.0050.04012.00
5.4.10.0080.03312.00
5.4.00.0080.04611.50
5.3.280.0120.04112.71
5.3.270.0100.04612.73
5.3.260.0100.04112.72
5.3.250.0050.05312.72
5.3.240.0070.03612.72
5.3.230.0050.04612.71
5.3.220.0100.04512.68
5.3.210.0090.04212.68
5.3.200.0090.03212.68
5.3.190.0080.03512.67
5.3.180.0060.04012.67
5.3.170.0100.04912.67
5.3.160.0050.03912.68
5.3.150.0080.05212.68
5.3.140.0050.04112.66
5.3.130.0090.04612.66
5.3.120.0050.04012.66
5.3.110.0100.05212.66
5.3.100.0110.03912.13
5.3.90.0040.04112.11
5.3.80.0060.03812.09
5.3.70.0060.04112.09
5.3.60.0040.04012.08
5.3.50.0080.03912.02
5.3.40.0080.04112.02
5.3.30.0050.04111.98
5.3.20.0050.03911.77
5.3.10.0070.03611.73
5.3.00.0060.03511.71
5.2.170.0070.0289.21
5.2.160.0090.0379.22
5.2.150.0070.0369.21
5.2.140.0030.0359.21
5.2.130.0040.0309.18
5.2.120.0080.0399.17
5.2.110.0080.0329.18
5.2.100.0090.0319.18
5.2.90.0050.0289.18
5.2.80.0020.0429.17
5.2.70.0050.0309.18
5.2.60.0070.0339.13
5.2.50.0050.0389.09
5.2.40.0090.0309.07
5.2.30.0060.0359.05
5.2.20.0050.0419.04
5.2.10.0070.0328.95
5.2.00.0040.0298.81
5.1.60.0120.0258.09
5.1.50.0050.0348.09
5.1.40.0080.0288.06
5.1.30.0050.0258.43
5.1.20.0070.0278.43
5.1.10.0050.0248.16
5.1.00.0090.0328.16
5.0.50.0030.0356.64
5.0.40.0030.0206.50
5.0.30.0060.0376.31
5.0.20.0060.0266.29
5.0.10.0040.0226.26
5.0.00.0060.0306.25
4.4.90.0040.0194.78
4.4.80.0070.0214.76
4.4.70.0030.0274.76
4.4.60.0050.0234.75
4.4.50.0050.0254.77
4.4.40.0030.0254.71
4.4.30.0050.0234.76
4.4.20.0050.0224.84
4.4.10.0050.0204.85
4.4.00.0020.0444.76
4.3.110.0020.0174.67
4.3.100.0030.0164.66
4.3.90.0010.0164.64
4.3.80.0030.0424.58
4.3.70.0030.0214.63
4.3.60.0030.0184.63
4.3.50.0040.0184.62
4.3.40.0040.0274.53
4.3.30.0050.0163.30
4.3.20.0040.0153.29
4.3.10.0020.0153.23
4.3.00.0200.0306.40

preferences:
137.98 ms | 1394 KiB | 7 Q