Use case
Even though PHP 5.3 is already out since more than one and a half year, a lot of web-hosters still don’t provide this version. In one of my projects I had to deal with the webhoster all-inkl. The project is written in PHP 5.3, but all-inkl supports PHP 5.2 only. Indeed they offer the possibility to use CGI version for PHP >5.2, but that doesn’t make me happy. So I tried to downgrade the project as successfull as possible.. But when it comes to 5.3′s Late Static Binding I faced problems to rebuild this functionality within 5.2. But after hours of searching the web and testing each approaches, I wrote my own hunky-dory function to fake LSB.
Solution
if( !function_exists( 'get_called_class' ) ) { class class_tools { static $i = 0; static $fl = null; static function get_called_class() { $bt = debug_backtrace(); if( self::$fl == $bt[2]['file'].$bt[2]['line'] ) { self::$i++; } else { self::$i = 0; self::$fl = $bt[2]['file'].$bt[2]['line']; } $lines = file($bt[2]['file']); preg_match_all( '/([a-zA-Z0-9\_]+)::'.$bt[2]['function'].'/', $lines[$bt[2]['line']-1], $matches ); return $matches[1][0]; } } function get_called_class() { return class_tools::get_called_class(); } }
Conclusion
This faked LSB gets only included if no native support for get_called_class exists (PHP <5.3). Otherwise the parser won’t recognize this code. Even though a lot of code examples don’t deal with the second index of the debug_backtrace-result ($bt[2]), for me it was/is the only way to make that LSB work correctly.
Buy flowers online Dubai from blush and petals flower shop in Dubai Marina. We offer free shipping* and same day delivery in Dubai.
https://blushpetals.ae/collections/buy-flowers-online-dubai
If you have a car and are too lazy to drive around, we are here to help you. Our professional drivers will take you to any location within The United Arab Emirates.
Royal Continental Hotel(hotel close to Dubai International Airport) offers business travelers and holidaymakers a stylish and welcoming haven just minutes from Dubai International Airport. With a variety of rooms to suit all requirements and tastes, as well as a host of business and leisure facilities, dining outlets and amenities, Royal Continental Hotel provides the discerning traveler with impeccable accommodation and service in relaxed contemporary surroundings, perfectly suited to both a short city break or an extended vacation.
Royal Continental Hotel(hotel close to Dubai International Airport) offers business travelers and holidaymakers a stylish and welcoming haven just minutes from Dubai International Airport.
https://royalcontinentalhotels.com/hotels-close-to-dubai-international-airport/
Foremost Driver is one of the leading chauffeured car service providers in the UAE. When you are looking for a reliable Safe Driver Dubai for yourself or your loved ones, our best drivers will meet your needs. Hire our skilled drivers on an hourly, daily, weekly, or monthly basis. Whether you need a one-time service or a Monthly Driver in Dubai, we’ve got you covered. Our services are customized to our customers’ needs. We have expertise in providing you with the best safe driving services. Just give us a call and let Foremost Driver handle the rest.
We provide 24/7 professional chauffeured car services to fulfill your traveling needs within Dubai and the UAE.
Contact Us:
+971 52 335 5475
https://foremostdrive.ae/services/monthly-driver-in-dubai/
At Seha Garden International Hospital, our Stroke Rehabilitation program helps survivors relearn skills that are lost following a stroke. Through a goal-oriented treatment plan that involves physical medicine, psychiatry, Ayurveda, physiotherapy, occupational and speech therapies, our cross-functional team works together to teach stroke patients new ways of performing tasks so they can regain independence and improve their quality of life.
https://sehagarden.com/treatments/stroke-rehabilitation/
Awesome Drive is the ultimate choice for exceptional driving service in Dubai. With a commitment to safety, our professional safe driver Dubai ensure a secure and comfortable journey for passengers. Equipped with extensive knowledge of Dubai’s roads and regulations, our drivers guarantee a smooth and efficient ride. Our fleet consists of well-maintained vehicles, and our drivers adhere to strict hygiene protocols.
https://awesomedrive.ae/
XLPE foams work well in the building and construction industry where thermal insulation, sound and vibration are critical, due to its low moisture permeability and high buoyancy.
https://airmasteremirates.com/product/cross-linked-polyolefin-foam-xlpe/
Located near Dubai International Airport, the Royal Continental Hotel is one of the Best 4 star Hotels in Dubai that offers excellent service, good value, and good quality.
Are you for in a situation where too exhausted to drive back to home like returning home from a party, long work schedule? Safe driver Dubai is ready to help you…
https://safedriverdubai.ae/
Royal Continental Hotel – A 4 Star Hotel in Dubai offers business travelers and holidaymakers a stylish and welcoming haven just minutes from Dubai International Airport. With a variety of rooms to suit all requirements and tastes, as well as a host of business and leisure facilities, dining outlets and amenities, Royal Continental Hotel provides the discerning traveler with impeccable accommodation and service in relaxed contemporary surroundings, perfectly suited to both a short city break or an extended vacation
https://royalcontinentalhotels.com/4-star-hotel-in-dubai/
If you are looking for a Luxury 4-star hotel near Dubai International Airport, near to Deira City Centre, near to Dubai Metro, Royal Continental Hotel is the best option for you. Royal Continental Hotel Dubai is the Best Luxury Business Hotel in Dubai which offers the Best Affordable stay in Dubai, UAE.
https://royalcontinentalhotels.com/4-star-hotel-in-dubai/
yes its true https://bit.ly/30coHyV
Thanks for sharing the information
https://piofront.com/
https://airmasteremirates.com/
https://airmastertape.com/
https://awesomedrive.ae/
https://brazilfloors.com/
Thanks, you saved my day :)
Thanks ;)