Similar Collections


This study list contains the PHP solved programs on object-oriented programming approaches such as class & objects, constructor & destructors, various inheritances, interfaces, abstract classes, constants, define, etc. Practice these programs to learn the concept of object-oriented programming approaches in PHP. Each program contains the solved code, output, and explanation.

questions

Title
PHP program to create an object of a class and access the class attributes
PHP program to create multiple objects of a class and access attributes of the class
PHP program to define methods within the class
PHP program to initialize data members without using the constructor
PHP program to print the size of the empty class
PHP program to create a class with setter and getter functions
PHP program to create a class to add two distances
PHP program to create a class to subtract one distance from another distance
PHP program to create a class to add two times
PHP program to convert seconds into hours, minutes, and seconds
PHP program to convert hours, minutes, and seconds into several seconds
PHP program to implement a cascaded function call
PHP program to create a constant using define() function
PHP program to create a case in-sensitive constant using define() function
PHP program to check a constant is defined or not
PHP program to print the line number using __LINE__ magic constant
PHP program to print the full path of the current program file
PHP program to print the function name using magic constant __FUNCTION__
PHP program to print the class name using magic constant __CLASS__
PHP program to print the method name with the associated class name using magic constant __METHOD__
total questions: 49

Questions

49

Views

754

Best Answers

299

Points

5