PHP Trait method works only on first load -


i'm using mamp php 5.4.10 , have problem following mwe:

<?php trait t {     public function hello() { echo 'hello'; } } class {     use t; } $a = new a(); $a->hello(); ?> 

the page shows 'hello' on first load. then, when hit refresh, error 500.

if modify file (just adding empty line somewhere instance) , refresh again, 'hello' shows again. hit refresh again, , error 500 back.

any clue might coming from?

update:

this shows in php errors log (nothing in apache errors log): php fatal error: call undefined method a::0? ()

(the 0 doesn't have same name when repeat operation).

xcache might problem here, try turning caching off (or @ least xcache) , try again


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -