3v4l.org

run code in 300+ PHP versions simultaneously
<?php // adiputra. Sabtu, 20 April 2013. function CariKata($s, $keyword1, $keyword2) { $l1=strlen($keyword1); $x1=strpos($s, $keyword1); $x2=strpos($s, $keyword2, $x1+$l1); $l=$x2-($x1+$l1); return substr($s, $x1+$l1, $l); } if( !function_exists("curl_init") ) { die("curl nya blom di aktifin ato di install"); } else { // mengambil data awal tiki online, gunanya untuk mengambil cookie di header page si TIKI $url_1 = "http://www.tiki-online.com/"; $c = curl_init(); curl_setopt($c, CURLOPT_AUTOREFERER, 1); curl_setopt($c, CURLOPT_HTTPGET, 1); curl_setopt($c, CURLINFO_HEADER_OUT,1); curl_setopt($c, CURLOPT_VERBOSE, 1); curl_setopt($c, CURLOPT_HEADER, 1); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($c, CURLOPT_URL, $url_1); $hasil_1 = curl_exec($c); curl_close($c); // echo $hasil_1; // proses ngambil cookie si tiki dari hasil curl hasil_1; $cookie = CariKata($hasil_1,'PHPSESSID=',';'); // echo $cookie; // data yg dipost tiki, kenapa empat data ? // dan dari mana kita tahu kalau si TIKI ada 4 variable. Cek di firebug, buat tab NETnya $postdata = array( "get_des" => "BEKASI", "get_ori" => "BANDUNG", "get_wg" => 1, "submit" => "Check" ); // get_des, get_ori ini masih hardcode, belum ada pengecekan kota yang tersedia di TIKI, jadi seharusnya ada proses pengecekan kota sih. $url_2 = "http://www.tiki-online.com/?cat=KgfdshfF7788KHfskF"; // url ini selalu statik, tapi mungkin berubah, jadi mesti dihandel. // curl untuk cek harga tiki. $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_URL, $url_2); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIE, "PHPSESSID=$cookie;"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $hasil_2 = curl_exec($ch); curl_close($ch); echo $hasil_2; // tinggal pecah2 data dari hasil_2 html untuk mengambil harga. }

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.40.0090.00918.96
8.3.30.0030.01120.29
8.3.20.0040.00420.34
8.3.10.0120.00322.10
8.3.00.0080.00022.47
8.2.170.0040.01122.96
8.2.160.0100.00322.17
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00320.86
8.2.110.0040.00421.90
8.2.100.0110.00017.91
8.2.90.0090.00019.04
8.2.80.0050.00319.46
8.2.70.0080.00017.63
8.2.60.0030.00618.05
8.2.50.0090.00018.07
8.2.40.0040.00419.89
8.2.30.0000.00819.62
8.2.20.0040.00417.68
8.2.10.0030.00617.76
8.2.00.0040.00417.91
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.97
8.1.230.0040.00819.22
8.1.220.0060.00317.91
8.1.210.0000.00818.77
8.1.200.0060.00317.24
8.1.190.0050.00317.66
8.1.180.0080.00019.01
8.1.170.0040.00418.78
8.1.160.0000.00718.80
8.1.150.0030.00618.64
8.1.140.0030.00517.34
8.1.130.0000.00717.91
8.1.120.0070.00017.45
8.1.110.0080.00017.47
8.1.100.0000.00817.45
8.1.90.0040.00417.55
8.1.80.0070.00017.43
8.1.70.0030.00517.38
8.1.60.0060.00317.56
8.1.50.0030.00617.44
8.1.40.0000.00817.50
8.1.30.0000.00717.56
8.1.20.0030.00617.63
8.1.10.0050.00217.40
8.1.00.0030.00617.32
8.0.300.0050.00318.77
8.0.290.0040.00417.18
8.0.280.0000.00818.46
8.0.270.0040.00417.14
8.0.260.0000.00616.94
8.0.250.0000.00617.03
8.0.240.0040.00417.09
8.0.230.0030.00316.98
8.0.220.0000.00717.03
8.0.210.0000.00717.01
8.0.200.0000.00717.01
8.0.190.0000.00817.01
8.0.180.0040.00416.99
8.0.170.0050.00316.99
8.0.160.0040.00416.86
8.0.150.0080.00016.84
8.0.140.0080.00016.86
8.0.130.0030.00313.43
8.0.120.0000.00716.96
8.0.110.0050.00217.02
8.0.100.0040.00417.07
8.0.90.0040.00416.88
8.0.80.0060.00916.96
8.0.70.0040.00416.92
8.0.60.0040.00416.84
8.0.50.0000.00716.93
8.0.30.0130.00917.04
8.0.20.0120.00517.40
8.0.10.0070.00016.94
8.0.00.0150.00616.76
7.4.330.0000.00515.00
7.4.320.0000.00716.46
7.4.300.0030.00316.50
7.4.290.0030.00316.53
7.4.280.0030.00316.55
7.4.270.0060.00016.59
7.4.260.0030.00313.26
7.4.250.0050.00316.34
7.4.240.0030.00316.55
7.4.230.0000.00716.59
7.4.220.0100.01216.63
7.4.210.0050.01016.52
7.4.200.0000.00716.57
7.4.190.0000.00716.30
7.4.160.0160.00016.38
7.4.150.0120.00617.40
7.4.140.0070.01017.86
7.4.130.0090.00916.60
7.4.120.0110.00616.65
7.4.110.0030.01316.52
7.4.100.0060.01316.50
7.4.90.0090.00916.35
7.4.80.0080.01119.39
7.4.70.0090.00916.58
7.4.60.0060.01216.46
7.4.50.0060.00316.61
7.4.40.0090.00322.77
7.4.30.0120.01016.56
7.4.00.0070.01115.21
7.3.330.0060.00013.17
7.3.320.0000.00513.12
7.3.310.0040.00416.31
7.3.300.0000.00616.32
7.3.290.0030.01016.33
7.3.280.0060.01016.25
7.3.270.0100.00617.40
7.3.260.0090.00916.38
7.3.250.0120.00516.46
7.3.240.0120.01216.36
7.3.230.0130.00316.39
7.3.210.0040.01416.51
7.3.200.0130.00319.39
7.3.190.0090.00916.24
7.3.180.0090.00616.30
7.3.170.0090.00916.52
7.3.160.0140.00516.26
7.3.120.0110.00314.80
7.2.330.0100.00716.51
7.2.320.0060.01516.79
7.2.310.0070.01016.67
7.2.300.0130.00316.61
7.2.290.0060.01016.66
7.2.60.0030.00916.77
7.1.200.0040.01115.90
7.1.70.0030.00717.10
7.1.60.0130.01019.32
7.1.50.0270.01034.68
7.1.00.0030.05022.28
7.0.200.0070.00016.40
7.0.140.0030.07321.98
7.0.100.0300.06720.06
7.0.90.0100.08320.10
7.0.80.0300.05319.89
7.0.70.0030.08019.97
7.0.60.0200.07020.06
7.0.50.0270.04720.32
7.0.40.0030.07720.07
7.0.30.0070.06020.13
7.0.20.0130.03720.18
7.0.10.0100.08019.95
7.0.00.0100.07320.18
5.6.280.0030.07020.80
5.6.250.0100.04320.58
5.6.240.0070.07720.52
5.6.230.0070.07720.78
5.6.220.0070.08320.55
5.6.210.0000.08320.70
5.6.200.0100.06321.06
5.6.190.0170.07321.15
5.6.180.0070.08020.99
5.6.170.0100.04721.11
5.6.160.0100.08021.08
5.6.150.0070.04721.05
5.6.140.0000.08321.07
5.6.130.0030.08020.96
5.6.120.0130.07021.04
5.6.110.0100.08021.11
5.6.100.0030.08321.03
5.6.90.0130.08021.10
5.6.80.0100.06320.33
5.6.70.0170.07320.49
5.6.60.0130.07320.57
5.6.50.0070.07720.39
5.6.40.0100.08020.45
5.6.30.0200.06720.49
5.6.20.0230.05320.40
5.6.10.0100.07020.32
5.6.00.0030.08320.48
5.5.380.0100.07720.44
5.5.370.0000.09020.60
5.5.360.0100.04320.36
5.5.350.0130.04320.47
5.5.340.0070.06020.89
5.5.330.0100.07720.94
5.5.320.0070.04720.92
5.5.310.0070.08020.94
5.5.300.0130.08020.76
5.5.290.0030.08320.91
5.5.280.0100.06020.80
5.5.270.0030.06020.66
5.5.260.0000.09720.81
5.5.250.0030.08320.61
5.5.240.0130.07720.25
5.5.230.0070.08320.32
5.5.220.0030.08320.31
5.5.210.0070.07320.18
5.5.200.0100.07320.21
5.5.190.0030.08320.26
5.5.180.0030.08320.29
5.5.160.0170.06720.02
5.5.150.0100.08320.01
5.5.140.0000.05020.29
5.5.130.0000.04720.28
5.5.120.0070.05320.27
5.5.110.0170.07020.22
5.5.100.0170.06720.01
5.5.90.0070.07319.97
5.5.80.0030.08020.00
5.5.70.0100.07020.12
5.5.60.0130.06719.99
5.5.50.0100.07019.99
5.5.40.0070.07320.16
5.5.30.0230.06320.02
5.5.20.0100.07319.98
5.5.10.0070.08020.09
5.5.00.0100.06320.06
5.4.450.0070.05719.36
5.4.440.0000.07019.33
5.4.430.0100.07319.51
5.4.420.0100.06019.51
5.4.410.0130.06719.34
5.4.400.0130.06719.11
5.4.390.0230.06019.05
5.4.380.0030.08019.19
5.4.370.0000.06719.13
5.4.360.0070.07019.25
5.4.350.0000.07718.85
5.4.340.0170.06719.18
5.4.320.0000.08318.90
5.4.310.0100.05719.05
5.4.300.0130.07019.23
5.4.290.0100.06719.16
5.4.280.0070.03719.21
5.4.270.0070.07718.88
5.4.260.0030.07719.18
5.4.250.0130.06318.95
5.4.240.0070.07719.16
5.4.230.0170.06319.04
5.4.220.0130.07018.89
5.4.210.0030.04719.16
5.4.200.0130.06719.18
5.4.190.0130.07319.04
5.4.180.0000.08719.18
5.4.170.0030.08019.22
5.4.160.0100.06719.20
5.4.150.0100.06719.16
5.4.140.0000.05716.43
5.4.130.0130.03316.42
5.4.120.0130.04316.42
5.4.110.0170.04716.62
5.4.100.0070.06716.48
5.4.90.0000.08016.30
5.4.80.0030.07016.46
5.4.70.0030.04316.37
5.4.60.0030.08016.46
5.4.50.0070.06716.26
5.4.40.0100.05316.42
5.4.30.0070.07316.45
5.4.20.0100.06316.31
5.4.10.0100.06316.34
5.4.00.0030.04315.70
5.3.290.0030.08314.72
5.3.280.0000.07014.67
5.3.270.0070.07314.55
5.3.260.0070.07714.56
5.3.250.0170.04014.61
5.3.240.0070.07314.68
5.3.230.0030.07314.56
5.3.220.0030.05014.64
5.3.210.0100.07314.52
5.3.200.0030.07714.57
5.3.190.0100.07314.68
5.3.180.0130.06714.57
5.3.170.0070.06714.62
5.3.160.0100.07014.71
5.3.150.0100.06014.64
5.3.140.0030.07714.52
5.3.130.0070.07014.55
5.3.120.0170.07014.57
5.3.110.0070.08014.64
5.3.100.0170.06714.18
5.3.90.0070.05714.05
5.3.80.0070.06713.93
5.3.70.0030.05314.11
5.3.60.0070.04014.14
5.3.50.0070.03314.04
5.3.40.0000.04013.95
5.3.30.0030.03713.96
5.3.20.0070.03313.82
5.3.10.0070.03713.61
5.3.00.0030.03713.68
5.2.170.0100.02312.17
5.2.160.0000.03312.17
5.2.150.0100.02312.17
5.2.140.0070.03012.17
5.2.130.0070.04012.17
5.2.120.0000.03012.17
5.2.110.0030.03012.17
5.2.100.0000.03012.17
5.2.90.0000.03012.17
5.2.80.0000.03312.17
5.2.70.0070.02312.17
5.2.60.0100.04312.17
5.2.50.0000.03712.17
5.2.40.0030.03012.17
5.2.30.0000.03012.17
5.2.20.0100.03312.17
5.2.10.0000.03012.17
5.2.00.0000.04312.17
5.1.60.0100.01712.17
5.1.50.0070.02012.17
5.1.40.0070.02012.17
5.1.30.0030.02312.17
5.1.20.0030.02712.17
5.1.10.0030.02312.17
5.1.00.0070.02012.17
5.0.50.0070.01712.17
5.0.40.0070.01312.17
5.0.30.0000.03312.17
5.0.20.0000.02312.17
5.0.10.0000.02012.17
5.0.00.0000.03012.17
4.4.90.0070.01012.17
4.4.80.0000.01712.17
4.4.70.0000.01712.17
4.4.60.0030.01312.17
4.4.50.0070.02312.17
4.4.40.0030.02312.17
4.4.30.0000.01712.17
4.4.20.0000.01712.17
4.4.10.0030.01312.17
4.4.00.0000.02712.17
4.3.110.0030.01312.17
4.3.100.0000.01712.17
4.3.90.0000.01712.17
4.3.80.0030.02012.17
4.3.70.0070.01012.17
4.3.60.0000.01312.17
4.3.50.0000.01712.17
4.3.40.0030.02312.17
4.3.30.0000.01712.17
4.3.20.0000.01712.17
4.3.10.0030.01312.17
4.3.00.0000.01712.17

preferences:
38.36 ms | 400 KiB | 5 Q