3v4l.org

run code in 300+ PHP versions simultaneously
<?php ######## NACITANIE DB ################################################################################ if ($str==1) $str_start=0; else $str_start=($str*$strankovanie)-$strankovanie; $_REQUEST["refresh"]="y"; //ak je profil a nieje strana tak refresh=y //zoradenie fotografii 0-cas pridania 1-hodnotenie 2-komentare if ($order==0) $order_by='date'; if ($order==1) $order_by='pocet_hodnotenie'; if ($order==2) $order_by='pocet_koment'; $smer_text="DESC"; ######## NACITANIE DB ################################################################################ $hodnotene_foto=array(); $hodnotene_cesta=array(); $pocet_komentovarray=array(); $pocet_hodnoteniearray=array(); $oblubenearray=array(); if (isset($_REQUEST["refresh"]) ) $refresh=$_REQUEST["refresh"]; else $refresh='n'; $sql ="SELECT fotoalbum.*, (SELECT user FROM users WHERE users.ID_user=fotoalbum.user_id) AS user, (SELECT meno FROM users WHERE users.ID_user=fotoalbum.user_id) AS meno, (SELECT priezvisko FROM users WHERE users.ID_user=fotoalbum.user_id) AS priezvisko, (SELECT COUNT(*) FROM fotoalbum WHERE style LIKE '%".$kat."') AS count, (SELECT COUNT(komentar) FROM komentare WHERE komentare.predmet='koment-foto' AND fotoalbum.ID_fotky=komentare.id_predmet ) AS pocet_koment, (SELECT SUM(znamka) FROM hodnotenie WHERE fotoalbum.ID_fotky=hodnotenie.foto_id ) AS pocet_hodnotenie, (SELECT oblubene.id_polozky FROM oblubene WHERE oblubene.id_polozky=fotoalbum.ID_fotky AND kategoria='foto-galeria' AND uzivatel='".$user_id."') AS oblubene FROM fotoalbum WHERE fotoalbum.style LIKE '%".$kat."' ".$profilfoto." GROUP BY fotoalbum.ID_fotky ORDER BY ".$order_by." ".$smer_text; //echo $sql; $result_fotoalbum=mysqli_query($con,$sql); if (mysqli_num_rows($result_fotoalbum)){ while ($row_fotoalbum=mysqli_fetch_assoc($result_fotoalbum)) { ##### ARRAY FOTOGRAFIE $pocet_komentovarray[]=intval($row_fotoalbum['pocet_koment']); $pocet_hodnoteniearray[]=intval($row_fotoalbum['pocet_hodnotenie']); $oblubenearray[]=intval($row_fotoalbum['oblubene']); $hodnotene_foto[]=$row_fotoalbum['ID_fotky']; $hodnotene_cesta[]=$row_fotoalbum['foto_id']; $hodnotene_name[]=$row_fotoalbum['foto_name']; $hodnotene_style[]=$row_fotoalbum['style']; $hodnotene_foto_name[]=$row_fotoalbum['foto_name']; if ($galeria=='profil') $seria=$row_fotoalbum['seria']; $hodnotene_spolupraca[]=$row_fotoalbum['spolupracovali']; $hodnotene_under18[]=$row_fotoalbum['under18']; $nick_pridal=$row_fotoalbum['user']; $meno_pridal=$row_fotoalbum["meno"]." ".$row_fotoalbum["priezvisko"]; if ($meno_pridal!=" ") $meno_pridal=$nick_pridal." (".$meno_pridal.")"; $hodnotene_menopridal[]=$meno_pridal; } mysqli_free_result($result_fotoalbum) ; } ######################################################################################################## ################# STRANKOVANIE $count=count($hodnotene_foto); if ($count > $strankovanie) $pages= ceil($count/$strankovanie); else $pages=1; $str_end= $str*$strankovanie; if ($str_end > $count) $str_end=$count; ?> <div class="frame-full" > <div class="perc50 left" style="margin-top:6px;"><?php echo $tabulkyusersarray[6].' '.($str_start+1).' - '.$str_end.' ('.$tabulkyusersarray[7].' '.$count.')';?></div> <div class="perc50 right" ><div id="pages" style=""><?php echo strankovanie($ciel,$str, $pages, $count, $strankovanie,10);?></div></div> </div> <?php ################# $pocet_strip=$str_start+$strankovanie; //pocet foto v jednom stripe //$key=array_search($id_hodnotenej, $hodnotene_foto); //poradie fotky v array for ($i=$str_start;$i<$pocet_strip;$i++) { if (isset($hodnotene_foto[$i])){ $pocet_komentov=$pocet_komentovarray[$i]; $pocet_hodnotenie=$pocet_hodnoteniearray[$i]; $oblubene=$oblubenearray[$i]; $id_fotky_strip=$hodnotene_foto[$i]; $foto_id_strip=$hodnotene_cesta[$i]; $meno_pridal=$hodnotene_menopridal[$i]; $under18=$hodnotene_under18[$i]; $foto_name=$hodnotene_foto_name[$i]; $foto_name=$hodnotene_name[$i]; $style=$hodnotene_style[$i]; $spolupraca=$hodnotene_spolupraca[$i]; $sirka=15; $margin="0 5px"; $font="1em"; $width=""; if ($pocet_hodnotenie!=0) $img_znamka="<div style='float:left;cursor:help;'><img style='float:left;margin:$margin;' src='".$static."images/others_ico/body.png' border='0' $width alt='z' title='$upload_array[10]'/><div style='float:left;font-size:$font;' title='hodnotenie'>".$pocet_hodnotenie.'</div></div>'; else $img_znamka=null; if ($pocet_komentov!=0) $img_koment="<div style='float:left;cursor:help;'><img style='float:left;margin:$margin;' src='".$static."images/others_ico/koment.png' border='0' $width alt='k' title='$upload_array[11]'/><div style='float:right;font-size:$font;' title='komentáre'>".$pocet_komentov.'</div></div>'; else $img_koment=null; if ($oblubene!=0) $img_love="<div style='float:right;margin:$margin;cursor:help;'><img style='' src='".$static."images/others_ico/love-min.png' border='0' $width alt='l' title='$upload_array[12]'/></div>"; else $img_love=null; ## ZOBRAZOVANIE FOTIEK $format=189; $obrazok=fotalbum_exist($foto_id_strip); //po novom uz ma foto_id aj priponu ?> <div class='<?php echo $perc_box;?> box_no_border shade ' style=''> <div style='position: relative;'> <a class='fancybox' rel='gallery' href='<?php echo $obrazok[0];?>' title='<?php echo $meno_pridal;?>'> <img class="fade" src='<?php echo $obrazok[1];?>' alt='' height='' width='100%' style='' title='' /> </a> </div> <div style='height:<?php echo $sirka;?>px;overflow:hidden;'><?php echo $img_znamka.$img_love.$img_koment;?></div> <?php if (($id_page==1)) { require "zobrazovanie_galerie_user.php"; } //if ($galeria=='galeria_profil') echo '<hr style="margin:3px auto;" /><h3 style="text-align:center;font-size:0.85em;">'.$galeriakategoriearray[$style].'</h3>'; ?> </div> <?php } } ?> <div class="frame-full" > <div class="perc50 left" style="margin-top:6px;"><?php echo $tabulkyusersarray[6].' '.($str_start+1).' - '.$str_end.' ('.$tabulkyusersarray[7].' '.$count.')';?></div> <div class="perc50 right" ><div id="pages" style=""><?php echo strankovanie($ciel,$str, $pages, $count, $strankovanie,10);?></div></div> </div> <script type="text/javascript"> jQuery(document).keydown(function(event){ var key=event.which; switch(key) { case 37: document.getElementById('stranka_lava').onclick() // Key left. break; case 39: document.getElementById('stranka_prava').onclick() // Key right. break; } }); </script> <script type="text/javascript"> $(".fancybox") .attr('rel', 'gallery') .fancybox({ padding : 0 }); </script>

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)
8.3.60.0070.01717.00
8.3.50.0070.01116.77
8.3.40.0150.00019.15
8.3.30.0110.01118.84
8.3.20.0080.00020.25
8.3.10.0050.00323.66
8.3.00.0070.00021.85
8.2.180.0070.00716.63
8.2.170.0090.00622.96
8.2.160.0100.00320.35
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0120.00621.11
8.2.120.0060.00326.35
8.2.110.0030.00619.33
8.2.100.0080.00418.03
8.2.90.0000.00919.34
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0040.00418.18
8.2.50.0040.00418.10
8.2.40.0050.00322.32
8.2.30.0040.00419.53
8.2.20.0030.00818.04
8.2.10.0030.00518.15
8.2.00.0000.00818.30
8.1.280.0070.01425.92
8.1.270.0070.01122.27
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0000.00823.92
8.1.230.0000.01219.61
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0030.00717.60
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0030.00518.52
8.1.160.0050.00320.90
8.1.150.0000.00818.87
8.1.140.0050.00319.68
8.1.130.0080.00017.75
8.1.120.0050.00217.52
8.1.110.0040.00417.64
8.1.100.0040.00417.57
8.1.90.0030.00517.50
8.1.80.0040.00417.47
8.1.70.0030.00517.55
8.1.60.0000.01017.63
8.1.50.0000.00817.58
8.1.40.0080.00017.64
8.1.30.0040.00417.75
8.1.20.0050.00317.81
8.1.10.0030.00517.61
8.1.00.0040.00417.63
8.0.300.0050.00318.77
8.0.290.0000.00916.88
8.0.280.0000.00718.63
8.0.270.0030.00517.29
8.0.260.0080.00017.31
8.0.250.0050.00317.10
8.0.240.0000.00717.14
8.0.230.0080.00017.15
8.0.220.0060.00317.11
8.0.210.0000.00716.99
8.0.200.0030.00317.13
8.0.190.0060.00316.98
8.0.180.0070.00017.07
8.0.170.0000.00817.08
8.0.160.0040.00417.04
8.0.150.0000.00716.93
8.0.140.0000.00917.00
8.0.130.0060.00013.45
8.0.120.0030.00516.95
8.0.110.0050.00217.07
8.0.100.0050.00316.95
8.0.90.0040.00416.86
8.0.80.0090.00617.04
8.0.70.0040.00416.93
8.0.60.0030.00517.13
8.0.50.0080.00016.90
8.0.30.0090.01117.27
8.0.20.0110.01117.40
8.0.10.0040.00417.09
8.0.00.0100.00917.05
7.4.330.0050.00016.77
7.4.320.0030.00316.77
7.4.300.0040.00416.73
7.4.290.0060.00316.63
7.4.280.0080.00016.62
7.4.270.0000.00716.63
7.4.260.0080.00416.60
7.4.250.0060.00316.59
7.4.240.0070.00016.60
7.4.230.0000.00716.79
7.4.220.0120.00816.69
7.4.210.0070.00816.72
7.4.200.0040.00416.81
7.4.160.0030.01416.74
7.4.150.0110.00717.40
7.4.140.0100.01017.86
7.4.130.0090.00916.79
7.4.120.0130.00916.63
7.4.110.0110.00716.78
7.4.100.0090.00916.66
7.4.90.0090.01516.79
7.4.80.0110.00619.39
7.4.70.0080.01416.50
7.4.60.0140.00416.79
7.4.50.0070.01016.57
7.4.40.0180.00016.62
7.4.30.0140.00316.59
7.4.00.0050.01215.19
7.3.330.0030.00313.24
7.3.320.0050.00013.27
7.3.310.0030.00316.46
7.3.300.0040.00416.55
7.3.290.0030.00416.52
7.3.280.0080.01016.48
7.3.270.0150.00317.40
7.3.260.0160.00716.53
7.3.250.0130.01016.63
7.3.240.0120.00616.59
7.3.230.0090.01016.54
7.3.210.0000.01816.55
7.3.200.0070.01019.39
7.3.190.0030.01416.66
7.3.180.0120.00616.54
7.3.170.0140.00316.64
7.3.160.0120.00916.61
7.3.120.0100.01015.07
7.3.110.0070.01015.15
7.3.100.0060.01314.70
7.3.90.0080.00415.03
7.3.80.0030.01214.74
7.3.70.0000.01315.04
7.3.60.0030.01015.01
7.3.50.0090.00315.07
7.3.40.0030.01215.17
7.3.30.0080.00814.71
7.3.20.0030.01016.73
7.3.10.0060.00616.73
7.3.00.0100.00516.54
7.2.330.0000.02616.77
7.2.320.0070.01716.59
7.2.310.0120.00616.66
7.2.300.0100.01016.92
7.2.290.0050.01116.75
7.2.250.0090.00915.45
7.2.240.0100.01115.07
7.2.230.0030.00915.07
7.2.220.0060.00615.10
7.2.210.0040.00715.09
7.2.200.0110.00415.34
7.2.190.0030.01015.26
7.2.180.0060.00615.20
7.2.170.0030.01415.04
7.2.130.0100.00616.57
7.2.120.0100.00616.73
7.2.110.0080.00816.74
7.2.100.0080.00816.79
7.2.90.0080.00816.75
7.2.80.0050.00616.82
7.2.70.0120.00516.73
7.2.60.0060.01016.73
7.2.50.0080.00616.89
7.2.40.0080.00816.81
7.2.30.0100.00716.63
7.2.20.0110.00516.79
7.2.10.0150.00316.79
7.2.00.0070.00517.76
7.1.330.0070.00715.87
7.1.320.0000.00915.61
7.1.310.0110.00315.97
7.1.300.0030.01015.89
7.1.290.0000.01215.85
7.1.280.0040.01415.91
7.1.270.0030.01015.84
7.1.260.0050.00515.94
7.1.250.0060.01015.70
7.1.240.0060.00815.49
7.1.230.0020.01115.71
7.1.220.0110.00515.47
7.1.210.0080.00515.66
7.1.200.0050.00715.63
7.1.190.0110.00415.66
7.1.180.0060.00515.78
7.1.170.0110.00415.49
7.1.160.0070.00915.72
7.1.150.0170.00015.79
7.1.140.0090.00515.80
7.1.130.0060.01115.63
7.1.120.0080.00415.60
7.1.110.0140.00315.68
7.1.100.0030.00816.55
7.1.90.0070.01015.90
7.1.80.0080.00515.57
7.1.70.0090.00716.17
7.1.60.0070.00816.96
7.1.50.0100.00316.14
7.1.40.0070.00615.81
7.1.30.0070.00915.61
7.1.20.0090.00215.41
7.1.10.0080.00415.59
7.1.00.0040.03117.75
7.0.330.0080.00415.42
7.0.320.0080.00715.11
7.0.310.0050.00815.02
7.0.300.0050.00615.19
7.0.290.0060.00915.14
7.0.280.0060.00815.19
7.0.270.0050.00715.36
7.0.260.0070.00515.14
7.0.250.0100.00515.26
7.0.240.0050.01115.13
7.0.230.0090.00615.13
7.0.220.0110.00815.30
7.0.210.0100.00515.23
7.0.200.0340.00415.23
7.0.190.0090.00415.35
7.0.180.0090.00415.22
7.0.170.0080.00615.38
7.0.160.0030.01015.27
7.0.150.0080.00515.41
7.0.140.0040.00915.18
7.0.130.0090.00315.13
7.0.120.0070.00415.21
7.0.110.0110.00515.32
7.0.100.0120.01716.88
7.0.90.0090.01916.85
7.0.80.0120.02516.81
7.0.70.0060.02016.84
7.0.60.0060.02716.76
7.0.50.0140.02516.86
7.0.40.0070.01615.60
7.0.30.0070.02015.53
7.0.20.0060.03615.42
7.0.10.0040.02815.52
7.0.00.0060.02015.40
5.6.380.0040.00914.35
5.6.370.0070.01014.44
5.6.360.0110.00314.44
5.6.350.0080.00914.03
5.6.340.0080.00814.43
5.6.330.0070.00714.57
5.6.320.0060.00714.44
5.6.310.0080.00514.64
5.6.300.0080.00414.71
5.6.290.0020.01114.33
5.6.280.0070.01316.58
5.6.270.0030.00714.37
5.6.260.0020.00714.44
5.6.250.0050.02016.52
5.6.240.0050.02716.45
5.6.230.0090.02816.39
5.6.220.0050.02216.41
5.6.210.0050.02216.31
5.6.200.0060.02116.43
5.6.190.0050.02616.56
5.6.180.0080.01916.74
5.6.170.0010.02416.45
5.6.160.0100.01816.68
5.6.150.0040.02416.57
5.6.140.0080.01916.63
5.6.130.0020.02016.54
5.6.120.0070.02016.56
5.6.110.0060.03016.70
5.6.100.0090.02516.55
5.6.90.0080.02216.59
5.6.80.0030.02616.39
5.6.70.0070.02716.26
5.6.60.0040.02116.22
5.6.50.0030.02416.38
5.6.40.0080.02716.30
5.6.30.0110.01516.43
5.6.20.0050.02416.42
5.6.10.0030.02416.26
5.6.00.0050.02916.27
5.5.380.0060.02814.27
5.5.370.0000.02314.25
5.5.360.0020.02414.18
5.5.350.0040.02614.23
5.5.340.0030.02414.37
5.5.330.0050.01914.34
5.5.320.0040.02014.35
5.5.310.0080.01514.36
5.5.300.0050.02214.43
5.5.290.0060.01814.31
5.5.280.0020.02114.34
5.5.270.0030.02814.40
5.5.260.0090.02014.37
5.5.250.0050.02614.40
5.5.240.0030.02614.04
5.5.230.0050.03014.17
5.5.220.0050.01814.19
5.5.210.0030.03114.13
5.5.200.0050.02714.13
5.5.190.0040.02014.12
5.5.180.0060.02014.17
5.5.170.0060.00511.06
5.5.160.0060.02514.07
5.5.150.0070.02814.12
5.5.140.0050.01914.13
5.5.130.0040.02114.12
5.5.120.0030.02414.23
5.5.110.0050.02014.20
5.5.100.0050.03014.20
5.5.90.0070.02014.07
5.5.80.0060.01814.08
5.5.70.0030.01914.12
5.5.60.0040.02214.07
5.5.50.0080.01814.12
5.5.40.0030.02314.16
5.5.30.0020.01814.07
5.5.20.0090.01814.12
5.5.10.0040.01914.03
5.5.00.0040.01914.07

preferences:
55.68 ms | 400 KiB | 5 Q