
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which is Faster: Constants, Variables or Variable Arrays in PHP
Constants in PHP are defined using the 'define' function. They are fairly slow in PHP.
There are instances where extensions (such as hidef) were written to improve the performance of the code.
This comes into picture when there are thousands of constants.
Beginning from PHP version 5.3, compile-time constants with the help of const NAME = VALUE; can also be used. They are relatively quicker.
Advertisements