Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
+1 is useless in your solutoin ,
am I right or I am missing something here ?
In PHP, all declared functions are global. So every time
rgb
is called,hex
will be defined in the global scope. The second time you callrgb
, it will try to definehex
again in the global scope and will produce an error becausehex
is already defined. The same thing occurs on your other hosting site if you try to run more than one test at a time (just add one moreprint rgb(148, 0, 211);
after your first one on the other site and you'll see).Maybe it's a matter of PHP version? This (somewhat old) post suggests that support for local funcitons in PHP is... uhhh.... PHPy.
Moving the local funciton to the global scope makes the solution work.