PHP Error: Trying to clone an uncloneable object of class ReflectionClass

August 11, 2009 – 7:35 am

I’ve recently run into this error when deploying symfony applications:

“Trying to clone an uncloneable object of class ReflectionClass”.

What’s causing this is a relatively common setting in php.ini, called “zend.ze1_compatibility_mode”, which enables php4 compatibility mode in php5. Specifically it affects a couple of object handling conventions (empty objects cast to FALSE, and - oh this is my favorite - objects are passed by value instead of by reference.. can you imagine how much fun debugging your php5 application would be if this setting didn’t actually save you by breaking things altogether?) Needless to say some hosts like to keep this turned on to me “more compatible” with the past. Also needless to say I hate some hosts.

The way around it is either changing the php.ini setting to:

zend.ze1_compatibility_mode=Off

or disabling it at runtime, before the application bootstraps, via:

ini_set("zend.ze1_compatibility_mode", "off");

Hope it helps someone.


Filed under: Rnadom Sftuf — Tags: — by Richtermeister

10 Comments »

  1. Хорошего Вам дня! ian@elektrashop.ru” rel=”nofollow”>……

    с ув….

    Trackback by Freeman — June 15, 2010 @ 9:27 pm

  2. Добрый день! jose@tehnon.ru” rel=”nofollow”>……

    с ув….

    Trackback by Kostya — June 19, 2010 @ 7:49 am

  3. PillSpot.org. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.PillSpot.org. Vitamins@buy.online” rel=”nofollow”>.…

    Categories: Anti-allergic/Asthma.Womens Health.Antidiabetic.Vitamins/Herbal Supplements.Pain Relief.Stop SmokingAntibiotics.Mens Health.Blood Pressure/Heart.Skin Care.Mental HealthStomach.Weight Loss.Eye Care.Antidepressants.Antiviral.Anxiety/Slee…

    Trackback by ALEJANDRO — June 25, 2010 @ 11:40 am


  4. PillSpot.org. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. No prescription drugs. Buy drugs online

    Buy:Female Cialis.Acomplia.Wellbutrin SR.Amoxicillin.Advair.Lasix.Cozaar.Nymphomax.Aricept.Female Pink Viagra.Ventolin.Seroquel.Benicar.Buspar.Zetia.Lipothin.Prozac.SleepWell.Lipitor.Zocor….

    Trackback by LYLE — July 3, 2010 @ 7:45 pm


  5. Medicamentspot.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. Low price pills. Buy drugs online

    Buy:Accutane.Arimidex.Lumigan.Prevacid.Actos.Zovirax.Nexium.100% Pure Okinawan Coral Calcium.Petcam (Metacam) Oral Suspension.Zyban.Synthroid.Prednisolone.Mega Hoodia.Retin-A.Human Growth Hormone.Valtrex….

    Trackback by MAURICE — July 21, 2010 @ 4:58 am

  6. cell http://uverizon6fotjo.ALLSTOCKSPORT.INFO/tag/new+Plan+cell/ : cell…

    Plan…

    Trackback by cell — August 29, 2010 @ 2:31 am

  7. makeup http://dmakeupnbbcyp.BABYCLOTHESNUT.INFO/tag/r2+Silicone+makeup/ : r2…

    Silicone…

    Trackback by makeup — August 29, 2010 @ 2:06 pm

  8. clock http://cmalittaugr.01DODGEPARTS.US/tag/Bar+clock+bud/ : bud…

    Bar…

    Trackback by bud — August 29, 2010 @ 5:58 pm


  9. CheapTabletsOnline.com. Canadian Health&Care.Best quality drugs.Special Internet Prices.No prescription online pharmacy. No prescription drugs. Order pills online

    Buy:Propecia.Viagra.Cialis Soft Tabs.Levitra.Super Active ED Pack.Maxaman.Cialis Professional.Cialis.Viagra Super Force.Viagra Super Active+.Cialis Super Active+.Tramadol.Soma.VPXL.Viagra Professional.Zithromax.Viagra Soft Tabs….

    Trackback by EVERETT — September 5, 2010 @ 9:40 am


  10. CheapTabletsOnline.Com. Canadian Health&Care.No prescription online pharmacy.Best quality drugs.Special Internet Prices. No prescription pills. Buy pills online

    Buy:Cialis Super Active+.Cialis.Viagra Soft Tabs.Propecia.Cialis Soft Tabs.Levitra.Cialis Professional.Super Active ED Pack.Tramadol.Viagra Super Active+.Viagra.VPXL.Maxaman.Zithromax.Viagra Super Force.Viagra Professional.Soma….

    Trackback by WADE — September 6, 2010 @ 6:00 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress