3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function contoh() { echo "Ini fungsi contoh dalam class A"; } } class A extends B { function contoh() { echo " Saya ini contoh dari B::contoh() sebagai fungsi tambahan"; } } // membuat variabel baru $b = new B; // memanggil fungsi contoh pada b $b->contoh();
Output for 5.0.0 - 5.6.21, 7.0.0 - 7.1.0RC5
Fatal error: Class 'B' not found in /in/eaDYq on line 8
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Class already declared: A in /in/eaDYq on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Class a: Cannot inherit from undefined class b in /in/eaDYq on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class a: Cannot inherit from undefined class b in /in/eaDYq on line 8