3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sambung=mysql_pconnect("localhost","root",""); if($sambung){ echo"Koneksi berhasil <br>"; } else{ echo"Koneksi gagal<brr>"; } $pilih=mysql_select_db("latihan"); $tabel="create table siswa(nomor int(10) auto_increment primary key, nama char(50), alamat char(250))"; $buat_tabel=mysql_query($tabel); if($buat_tabel){ echo"Tabel siswa berhasil dibuat"; } else{ echo"Tabel siswa gagal dibuat:".mysql_error(); } ?>
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /in/eu2dl:2 Stack trace: #0 {main} thrown in /in/eu2dl on line 2
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_pconnect() in /in/eu2dl on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_pconnect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/eu2dl on line 2 Koneksi gagal<brr> Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/eu2dl on line 10 Warning: mysql_select_db(): A link to the server could not be established in /in/eu2dl on line 10 Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/eu2dl on line 13 Warning: mysql_query(): A link to the server could not be established in /in/eu2dl on line 13 Tabel siswa gagal dibuat:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Output for 4.3.0 - 4.3.1
Warning: mysql_pconnect() [http://www.php.net/function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/eu2dl on line 2 Koneksi gagal<brr> Warning: mysql_select_db() [http://www.php.net/function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/eu2dl on line 10 Warning: mysql_select_db() [http://www.php.net/function.mysql-select-db]: A link to the server could not be established in /in/eu2dl on line 10 Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/eu2dl on line 13 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/eu2dl on line 13 Tabel siswa gagal dibuat:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)