3v4l.org

run code in 300+ PHP versions simultaneously
<?hh // 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.60.0140.00016.63
8.3.50.0250.00521.93
8.3.40.0090.00618.72
8.3.30.0110.00418.74
8.3.20.0000.00820.21
8.3.10.0000.00823.64
8.3.00.0030.00620.83
8.2.180.0150.00716.38
8.2.170.0100.00322.96
8.2.160.0100.00320.41
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0080.00026.16
8.2.120.0040.00419.23
8.2.110.0060.00322.25
8.2.100.0110.00017.66
8.2.90.0040.00417.72
8.2.80.0000.00817.97
8.2.70.0030.00617.48
8.2.60.0030.00517.92
8.2.50.0030.00518.07
8.2.40.0030.00618.03
8.2.30.0060.00318.11
8.2.20.0000.00817.60
8.2.10.0000.00717.83
8.2.00.0050.00319.21
8.1.280.0000.01425.92
8.1.270.0000.00822.19
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0070.01022.46
8.1.230.0070.00320.99
8.1.220.0080.00017.74
8.1.210.0000.00818.96
8.1.200.0040.00417.23
8.1.190.0050.00317.10
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0000.00721.92
8.1.150.0040.00418.53
8.1.140.0000.00817.29
8.1.130.0070.00017.74
8.1.120.0000.00717.29
8.1.110.0040.00417.30
8.1.100.0070.00017.30
8.1.90.0030.00317.34
8.1.80.0070.00017.31
8.1.70.0030.00317.23
8.1.60.0000.00717.47
8.1.50.0000.00817.27
8.1.40.0000.00717.34
8.1.30.0040.00417.35
8.1.20.0050.00317.45
8.1.10.0040.00417.44
8.1.00.0040.00417.25
8.0.300.0070.00019.98
8.0.290.0000.00816.63
8.0.280.0050.00218.32
8.0.270.0030.00317.18
8.0.260.0000.00617.05
8.0.250.0030.00316.73
8.0.240.0080.00016.73
8.0.230.0050.00316.71
8.0.220.0000.00616.75
8.0.210.0000.00616.75
8.0.200.0030.00316.89
8.0.190.0050.00316.82
8.0.180.0080.00016.72
8.0.170.0000.00816.79
8.0.160.0040.00416.71
8.0.150.0000.00716.69
8.0.140.0040.00416.64
8.0.130.0030.00313.38
8.0.120.0000.00716.69
8.0.110.0070.00016.65
8.0.100.0000.00916.74
8.0.90.0000.00816.71
8.0.80.0060.01016.66
8.0.70.0040.00416.78
8.0.60.0000.00716.71
8.0.50.0040.00416.62
8.0.30.0130.00617.15
8.0.20.0150.00517.40
8.0.10.0000.00716.77
8.0.00.0080.01116.60
7.4.330.0000.00715.00
7.4.320.0060.00016.38
7.4.300.0000.00616.37
7.4.290.0030.00316.44
7.4.280.0000.00816.34
7.4.270.0000.00716.35
7.4.260.0050.00316.35
7.4.250.0050.00216.29
7.4.240.0020.00516.40
7.4.230.0000.00716.21
7.4.220.0120.00616.26
7.4.210.0090.01016.38
7.4.200.0000.00716.29
7.4.160.0000.01816.55
7.4.150.0180.00017.40
7.4.140.0070.01317.86
7.4.130.0070.01116.42
7.4.120.0060.01016.34
7.4.110.0110.00616.38
7.4.100.0090.00916.28
7.4.90.0130.00316.54
7.4.80.0150.00919.39
7.4.70.0110.01116.49
7.4.60.0070.01016.17
7.4.50.0030.00516.42
7.4.40.0060.01316.41
7.4.30.0090.00616.25
7.3.330.0000.00513.00
7.3.320.0060.00013.19
7.3.310.0030.00316.24
7.3.300.0030.00316.17
7.3.290.0100.00716.12
7.3.280.0110.00916.17
7.3.270.0090.00817.40
7.3.260.0180.00616.15
7.3.250.0110.00616.30
7.3.240.0110.00816.12
7.3.230.0140.00316.39
7.3.210.0090.00916.14
7.3.200.0190.00319.39
7.3.190.0110.00616.32
7.3.180.0080.00816.17
7.3.170.0110.00316.27
7.3.160.0030.01416.26
7.2.330.0130.00616.24
7.2.320.0140.00716.41
7.2.310.0070.01016.38
7.2.300.0060.01016.53
7.2.290.0090.00616.34
5.4.320.0070.03712.46
5.4.310.0070.04312.45
5.4.300.0060.04012.46
5.4.290.0040.03912.45
5.4.280.0050.03512.35
5.4.270.0030.03812.35
5.4.260.0030.04012.35
5.4.250.0050.03912.35
5.4.240.0080.03512.35
5.4.230.0060.04212.34
5.4.220.0050.03712.34
5.4.210.0050.03512.34
5.4.200.0050.03812.34
5.4.190.0060.03512.34
5.4.180.0060.03612.34
5.4.170.0060.03712.35
5.4.160.0090.03312.35
5.4.150.0100.04312.34
5.4.140.0040.04512.02
5.4.130.0040.04812.01
5.4.120.0080.04011.97
5.4.110.0050.03511.96
5.4.100.0070.03411.96
5.4.90.0040.04011.96
5.4.80.0060.03611.96
5.4.70.0040.03711.96
5.4.60.0070.03811.96
5.4.50.0070.03311.96
5.4.40.0080.03811.95
5.4.30.0060.03411.95
5.4.20.0060.03511.95
5.4.10.0050.03411.95
5.4.00.0090.03911.43
5.3.290.0080.04612.80
5.3.280.0040.04612.71
5.3.270.0050.03912.72
5.3.260.0100.03812.72
5.3.250.0060.03712.71
5.3.240.0060.04412.72
5.3.230.0070.04212.71
5.3.220.0080.04312.68
5.3.210.0050.04012.68
5.3.200.0050.03712.68
5.3.190.0060.03712.68
5.3.180.0090.03312.67
5.3.170.0070.03512.66
5.3.160.0070.03512.67
5.3.150.0050.03712.68
5.3.140.0100.03712.66
5.3.130.0050.04012.66
5.3.120.0070.03712.66
5.3.110.0100.03412.66
5.3.100.0050.03812.12
5.3.90.0080.03812.08
5.3.80.0080.03812.07
5.3.70.0040.03812.07
5.3.60.0030.03912.07
5.3.50.0080.03612.00
5.3.40.0050.03612.00
5.3.30.0080.04411.94
5.3.20.0030.03911.72
5.3.10.0030.03711.69
5.3.00.0100.03711.67

preferences:
35.13 ms | 400 KiB | 5 Q